From patchwork Wed Aug 7 07:37:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Xiang X-Patchwork-Id: 265384 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B5A022C0098 for ; Wed, 7 Aug 2013 17:41:25 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932247Ab3HGHhl (ORCPT ); Wed, 7 Aug 2013 03:37:41 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:45635 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932146Ab3HGHhj (ORCPT ); Wed, 7 Aug 2013 03:37:39 -0400 Received: from 172.24.2.119 (EHLO szxeml213-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BFQ12496; Wed, 07 Aug 2013 15:37:35 +0800 (CST) Received: from SZXEML409-HUB.china.huawei.com (10.82.67.136) by szxeml213-edg.china.huawei.com (172.24.2.30) with Microsoft SMTP Server (TLS) id 14.1.323.7; Wed, 7 Aug 2013 15:37:34 +0800 Received: from localhost (10.135.72.188) by szxeml409-hub.china.huawei.com (10.82.67.136) with Microsoft SMTP Server id 14.1.323.7; Wed, 7 Aug 2013 15:37:25 +0800 From: Rui Xiang To: , CC: , , , , , , , , Rui Xiang Subject: [PATCH v3 06/11] syslog_ns: use init syslog_ns for console action Date: Wed, 7 Aug 2013 15:37:10 +0800 Message-ID: <1375861035-24320-7-git-send-email-rui.xiang@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1375861035-24320-1-git-send-email-rui.xiang@huawei.com> References: <1375861035-24320-1-git-send-email-rui.xiang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.135.72.188] X-CFilter-Loop: Reflected Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org While flags SYSLOG_ACTION_CONSOLE_ON/OFF/LEVEL of console actin are used in syslog syscall, the related hanlding should be targeted at host by init_syslog_ns. Signed-off-by: Rui Xiang --- kernel/printk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/printk.c b/kernel/printk.c index ca951e7..bdb7ed4 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -373,6 +373,11 @@ static int check_syslog_permissions(int type, bool from_file, if (from_file && type != SYSLOG_ACTION_OPEN) return 0; + if (type == SYSLOG_ACTION_CONSOLE_OFF + || type == SYSLOG_ACTION_CONSOLE_ON + || type == SYSLOG_ACTION_CONSOLE_LEVEL) + ns = &init_syslog_ns; + if (syslog_action_restricted(type, ns)) { if (ns_capable(ns->owner, CAP_SYSLOG)) return 0;