]> git.baikalelectronics.ru Git - kernel.git/commit
user namespace: fix copy_user_ns return value
authorSerge E. Hallyn <serue@us.ibm.com>
Tue, 17 Jul 2007 19:28:17 +0000 (15:28 -0400)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Jul 2007 21:05:08 +0000 (14:05 -0700)
commitd0b93e2c21a344c4d125e803f3676cfdb3c72ffd
tree3ff83cc510f09bd0561b3b2a8b769beda952ad17
parent87bd5c6695a37eb614981a7d9bc6d86d2fb550a6
user namespace: fix copy_user_ns return value

When a CONFIG_USER_NS=n and a user tries to unshare some namespace other
than the user namespace, the dummy copy_user_ns returns NULL rather than
the old_ns.

This value then gets assigned to task->nsproxy->user_ns, so that a
subsequent setuid, which uses task->nsproxy->user_ns, causes a NULL
pointer deref.

Fix this by returning old_ns.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/user_namespace.h