From patchwork Thu Mar 5 08:57:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 446645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 03E4214015A; Thu, 5 Mar 2015 19:57:53 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1YTRbF-00036F-G4; Thu, 05 Mar 2015 08:57:45 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1YTRbA-00036A-Uu for kernel-team@lists.ubuntu.com; Thu, 05 Mar 2015 08:57:40 +0000 Received: from static-50-53-56-177.bvtn.or.frontiernet.net ([50.53.56.177] helo=[192.168.192.131]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YTRb2-0005TG-9I for kernel-team@lists.ubuntu.com; Thu, 05 Mar 2015 08:57:36 +0000 Message-ID: <54F81A77.10404@canonical.com> Date: Thu, 05 Mar 2015 00:57:27 -0800 From: John Johansen Organization: Canonical User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Kernel team list Subject: [PATCH][Mako][Manta][Flo][Goldfish]: UBUNTU: SAUCE: (no-up): apparmor: Fix backports fd_inheritance regression X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com The backport patch series will not be upstreamed as it is for porting current versions of apparmor to older kernel versions. BugLink: http://bugs.launchpad.net/bugs/1423810 On pre 3.5 kernels with the apparmor 3 backport patchset (Mako, Manta, Flo, Goldfish, ...) running the fd_inheritance test from the apparmor regression tests causes the kernel to crash and spontaneously reboot the device. This is due to a ref count bug, caused by the backport macro not correctly dealing with changes to dentry_open introduced in the commit 765927b2d508712d320c8934db963bbe14c3fcec. Signed-off-by: John Johansen --- security/apparmor/include/backport.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/apparmor/include/backport.h b/security/apparmor/include/backport.h index 046ca70..623ed40 100644 --- a/security/apparmor/include/backport.h +++ b/security/apparmor/include/backport.h @@ -40,7 +40,8 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags); #define uid_eq(X, Y) ((X) == (Y)) /* 3.5 backport commit 765927b2d508712d320c8934db963bbe14c3fcec */ -#define dentry_open(P, F, C) (dentry_open)((P)->dentry, (P)->mnt, (F), (C)) +#include /* For mntget */ +#define dentry_open(P, F, C) (dentry_open)(dget((P)->dentry), mntget((P)->mnt), (F), (C)) /* 3.4 backport, commit d007794a182bc072a7b7479909dbd0d67ba341be */ #include