From patchwork Tue Apr 13 07:09:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 50039 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 43B40B7CF3 for ; Tue, 13 Apr 2010 17:10:20 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1O1aGE-0005vn-5J; Tue, 13 Apr 2010 08:10:14 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1O1aFy-0005i6-JL for kernel-team@lists.ubuntu.com; Tue, 13 Apr 2010 08:09:58 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1O1aFy-0003De-Hj; Tue, 13 Apr 2010 08:09:58 +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 1O1aFy-0002ae-5o; Tue, 13 Apr 2010 08:09:58 +0100 From: john.johansen@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH 05/11] AppArmor: fix regression by setting default to mediate deleted files Date: Tue, 13 Apr 2010 00:09:34 -0700 Message-Id: <1271142580-26555-6-git-send-email-john.johansen@canonical.com> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1271142580-26555-1-git-send-email-john.johansen@canonical.com> References: <1271142580-26555-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 OriginalAuthor: John Johansen OriginalLocation: git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparm$ commit: 8d3ffc7c845dc1277b39572016fbf3265702f4d4 BugLink: http://bugs.launchpad.net/bugs/562056 The default behavior for AppArmor used to be to mediate deleted files. This can now be controlled on a per profile basis but the field is not defaulting to the correct value when path_flags is not specified. This is causing regressions in profiles expecting deleted files to be mediated by path instead of delegated. Signed-off-by: John Johansen Acked-by: Andy Whitcroft --- security/apparmor/policy_unpack.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index a475d7c..0a15f41 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -507,8 +507,11 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, goto fail; /* path_flags is optional */ - unpack_u32(e, &profile->path_flags, "path_flags"); - profile->path_flags |= profile->flags & PFLAG_MEDIATE_DELETED; + if (unpack_u32(e, &profile->path_flags, "path_flags")) + profile->path_flags |= profile->flags & PFLAG_MEDIATE_DELETED; + else + /* default to */ + profile->path_flags = PFLAG_MEDIATE_DELETED; /* mmap_min_addr is optional */ if (unpack_u64(e, &tmp64, "mmap_min_addr")) {