From patchwork Mon Feb 6 10:39:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [natty, natty/ti-omap4, CVE, 1/1] TOMOYO: Fix oops in tomoyo_mount_acl(). Date: Mon, 06 Feb 2012 00:39:25 -0000 From: Andy Whitcroft X-Patchwork-Id: 139707 Message-Id: <1328524765-18910-2-git-send-email-apw@canonical.com> To: kernel-team@lists.ubuntu.com Cc: Andy Whitcroft 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; }