From patchwork Thu Feb 24 17:40:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 84413 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 82D03B7108 for ; Fri, 25 Feb 2011 04:40:45 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1PsfB7-0000yT-BD; Thu, 24 Feb 2011 17:40:37 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1PsfB5-0000yK-AG for kernel-team@lists.ubuntu.com; Thu, 24 Feb 2011 17:40:35 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1PsfB5-0006D0-7w for ; Thu, 24 Feb 2011 17:40:35 +0000 Received: from pool-74-107-151-238.ptldor.fios.verizon.net ([74.107.151.238] helo=[192.168.1.103]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PsfB5-0005Gc-0N for kernel-team@lists.ubuntu.com; Thu, 24 Feb 2011 17:40:35 +0000 Message-ID: <4D66980F.4050704@canonical.com> Date: Thu, 24 Feb 2011 09:40:31 -0800 From: John Johansen Organization: Canonical User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Kernel team list Subject: [natty] Fix aufs calling of security_path_mknod X-Enigmail-Version: 1.1.2 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Fix aufs calling of security_path_mknod BugLink: http://launchpad.net/bugs/724456 The security_path_mknod hook requires an encoded 'dev' for its 'dev' paramet but aufs is calling security_path_mknod with a 'dev' that was already converted by 'new_decode_dev(dev)'. However security_path_mknod and its consumer TOMOYO is expecting 'dev' rather than 'new_decode_dev(dev)'. This will result in TOMOYO doing new_decode_dev(new_decode_dev(dev)) (which is wrong) when security_path_mknod() is called from aufs' vfsub_mknod Signed-off-by: Tetsuo Handa Signed-off-by: John Johansen diff --git a/ubuntu/aufs/vfsub.c b/ubuntu/aufs/vfsub.c index 6ce2fd5..40f6aef 100644 --- a/ubuntu/aufs/vfsub.c +++ b/ubuntu/aufs/vfsub.c @@ -276,7 +276,7 @@ int vfsub_mknod(struct inode *dir, struct path *path, int mo d = path->dentry; path->dentry = d->d_parent; - err = security_path_mknod(path, d, mode, dev); + err = security_path_mknod(path, d, mode, new_encode_dev(dev)); path->dentry = d; if (unlikely(err)) goto out;