From patchwork Mon Feb 6 10:39:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 139707 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 5E0AE1007D1 for ; Mon, 6 Feb 2012 21:39:43 +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 1RuLyr-0008LC-Iw; Mon, 06 Feb 2012 10:39:29 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RuLyp-0008L7-7o for kernel-team@lists.ubuntu.com; Mon, 06 Feb 2012 10:39:27 +0000 Received: from [85.210.149.110] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1RuLyp-0001g9-3c; Mon, 06 Feb 2012 10:39:27 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [natty, natty/ti-omap4 CVE 1/1] TOMOYO: Fix oops in tomoyo_mount_acl(). Date: Mon, 6 Feb 2012 10:39:25 +0000 Message-Id: <1328524765-18910-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1328524765-18910-1-git-send-email-apw@canonical.com> References: <1328524765-18910-1-git-send-email-apw@canonical.com> Cc: Andy Whitcroft 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: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Tetsuo Handa In tomoyo_mount_acl() since 2.6.36, kern_path() was called without checking dev_name != NULL. As a result, an unprivileged user can trigger oops by issuing mount(NULL, "/", "ext3", 0, NULL) request. Fix this by checking dev_name != NULL before calling kern_path(dev_name). Signed-off-by: Tetsuo Handa Cc: stable@kernel.org Signed-off-by: James Morris (cherry picked from commit 4e78c724d47e2342aa8fde61f6b8536f662f795f) CVE-2011-2518 BugLink: http://bugs.launchpad.net/bugs/922377 Signed-off-by: Andy Whitcroft Acked-by: Stefan Bader Acked-by: Colin King --- security/tomoyo/mount.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/security/tomoyo/mount.c b/security/tomoyo/mount.c index 82bf8c2..afa07cf 100644 --- a/security/tomoyo/mount.c +++ b/security/tomoyo/mount.c @@ -138,7 +138,7 @@ static int tomoyo_mount_acl(struct tomoyo_request_info *r, char *dev_name, } if (need_dev) { /* Get mount point or device file. */ - if (kern_path(dev_name, LOOKUP_FOLLOW, &path)) { + if (!dev_name || kern_path(dev_name, LOOKUP_FOLLOW, &path)) { error = -ENOENT; goto out; }