Skip to content

Commit

Permalink
TOMOYO: Fix oops in tomoyo_mount_acl().
Browse files Browse the repository at this point in the history
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 <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: stable@kernel.org
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Tetsuo Handa authored and James Morris committed Jun 14, 2011
1 parent 2c53b43 commit 4e78c72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/tomoyo/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4e78c72

Please sign in to comment.