Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934041Ab3FSBxs (ORCPT ); Tue, 18 Jun 2013 21:53:48 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:59195 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S934092Ab3FSBxL (ORCPT ); Tue, 18 Jun 2013 21:53:11 -0400 X-IronPort-AV: E=Sophos;i="4.87,893,1363104000"; d="scan'208";a="7596297" From: Gao feng To: containers@lists.linux-foundation.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Cc: eparis@redhat.com, serge.hallyn@ubuntu.com, ebiederm@xmission.com, sgrubb@redhat.com, aris@redhat.com, matthltc@linux.vnet.ibm.com, Gao feng Subject: [PATCH 13/22] Audit: only allow init user namespace to change rate limit Date: Wed, 19 Jun 2013 09:53:45 +0800 Message-Id: <1371606834-5802-14-git-send-email-gaofeng@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1371606834-5802-1-git-send-email-gaofeng@cn.fujitsu.com> References: <1371606834-5802-1-git-send-email-gaofeng@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/19 09:51:56, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/19 09:52:01, Serialize complete at 2013/06/19 09:52:01 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 958 Lines: 31 Because We want to avoid the DoS attack caused by other user namespace,so don't make audit_rate_limit per user namespace. And only init user namespace has rights to change it. Signed-off-by: Gao feng --- kernel/audit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/audit.c b/kernel/audit.c index 0b9cef2..306231d 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -295,6 +295,9 @@ static int audit_do_config_change(char *function_name, int *to_change, int new) static int audit_set_rate_limit(int limit) { + if (current_user_ns() != &init_user_ns) + return -EPERM; + return audit_do_config_change("audit_rate_limit", &audit_rate_limit, limit); } -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/