From patchwork Tue Mar 30 17:39:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 48999 X-Patchwork-Delegate: apw@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 7066AB7CB6 for ; Wed, 31 Mar 2010 04:39:26 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NwfPL-00087J-Gj; Tue, 30 Mar 2010 18:39:19 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NwfPJ-00086M-LM for kernel-team@lists.ubuntu.com; Tue, 30 Mar 2010 18:39:17 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1NwfPJ-0006Pd-Jx for ; Tue, 30 Mar 2010 18:39:17 +0100 Received: from [96.225.230.137] (helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1NwfPJ-0004e9-7j for kernel-team@lists.ubuntu.com; Tue, 30 Mar 2010 18:39:17 +0100 From: john.johansen@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/4] AppArmor: Stop page allocation warnings that can occur on policy load Date: Tue, 30 Mar 2010 10:39:08 -0700 Message-Id: <1269970750-25624-3-git-send-email-john.johansen@canonical.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1269970750-25624-1-git-send-email-john.johansen@canonical.com> References: <1269970750-25624-1-git-send-email-john.johansen@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: John Johansen Buglink: http://launchpad.net/bugs/458299 Policy load can allocate larger than page chunks of memory, but it will attempt to use kmalloc first, and then only fall back to vmalloc if it needs to. Currently the NO_WARN flag is missing from kmalloc so it dumps a warning message, when it fails. As this isn't a real failure lets quiet the warnings. Signed-off-by: John Johansen --- security/apparmor/apparmorfs.c | 2 +- security/apparmor/match.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 89a26a0..a852d06 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -41,7 +41,7 @@ static void *kvmalloc(size_t size) if (size == 0) return NULL; - buffer = kmalloc(size, GFP_KERNEL); + buffer = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); if (!buffer) buffer = vmalloc(size); return buffer; diff --git a/security/apparmor/match.c b/security/apparmor/match.c index 677d1c2..5a55959 100644 --- a/security/apparmor/match.c +++ b/security/apparmor/match.c @@ -72,7 +72,7 @@ static struct table_header *unpack_table(char *blob, size_t bsize) goto out; /* freed by free_table */ - table = kmalloc(tsize, GFP_KERNEL); + table = kmalloc(tsize, GFP_KERNEL | __GFP_NOWARN); if (!table) table = vmalloc(tsize); if (table) {