From: Greg Kroah-Hartman Date: Wed, 13 Mar 2013 23:27:06 +0000 (-0700) Subject: 3.8-stable patches X-Git-Tag: v3.8.3~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a59d45c23d722c2af230807487071021208fe2c9;p=thirdparty%2Fkernel%2Fstable-queue.git 3.8-stable patches added patches: 6lowpan-remove-__init-tag-from-lowpan_netlink_fini.patch userns-don-t-allow-clone_newuser-clone_fs.patch --- diff --git a/queue-3.8/6lowpan-remove-__init-tag-from-lowpan_netlink_fini.patch b/queue-3.8/6lowpan-remove-__init-tag-from-lowpan_netlink_fini.patch new file mode 100644 index 00000000000..cc9d78d4cfd --- /dev/null +++ b/queue-3.8/6lowpan-remove-__init-tag-from-lowpan_netlink_fini.patch @@ -0,0 +1,30 @@ +From a07fdceccf9d9f1b87f781e9a87662182e590d70 Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Wed, 6 Feb 2013 15:54:38 -0500 +Subject: 6lowpan: Remove __init tag from lowpan_netlink_fini(). + +From: "David S. Miller" + +commit a07fdceccf9d9f1b87f781e9a87662182e590d70 upstream. + +It's called from both __init and __exit code, so neither +tag is appropriate. + +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/ieee802154/6lowpan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ieee802154/6lowpan.c ++++ b/net/ieee802154/6lowpan.c +@@ -1234,7 +1234,7 @@ static inline int __init lowpan_netlink_ + return rtnl_link_register(&lowpan_link_ops); + } + +-static inline void __init lowpan_netlink_fini(void) ++static inline void lowpan_netlink_fini(void) + { + rtnl_link_unregister(&lowpan_link_ops); + } diff --git a/queue-3.8/series b/queue-3.8/series index 675116f9d72..d88fa51c9e2 100644 --- a/queue-3.8/series +++ b/queue-3.8/series @@ -98,3 +98,5 @@ usb-rip-out-recursive-call-on-warm-port-reset.patch usb-fix-connected-device-switch-to-inactive-state.patch revert-xen-blkback-don-t-trust-the-handle-from-the-frontend.patch w1-gpio-fix-section-mismatch.patch +userns-don-t-allow-clone_newuser-clone_fs.patch +6lowpan-remove-__init-tag-from-lowpan_netlink_fini.patch diff --git a/queue-3.8/userns-don-t-allow-clone_newuser-clone_fs.patch b/queue-3.8/userns-don-t-allow-clone_newuser-clone_fs.patch new file mode 100644 index 00000000000..130d35de4d6 --- /dev/null +++ b/queue-3.8/userns-don-t-allow-clone_newuser-clone_fs.patch @@ -0,0 +1,73 @@ +From e66eded8309ebf679d3d3c1f5820d1f2ca332c71 Mon Sep 17 00:00:00 2001 +From: "Eric W. Biederman" +Date: Wed, 13 Mar 2013 11:51:49 -0700 +Subject: userns: Don't allow CLONE_NEWUSER | CLONE_FS + +From: "Eric W. Biederman" + +commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71 upstream. + +Don't allowing sharing the root directory with processes in a +different user namespace. There doesn't seem to be any point, and to +allow it would require the overhead of putting a user namespace +reference in fs_struct (for permission checks) and incrementing that +reference count on practically every call to fork. + +So just perform the inexpensive test of forbidding sharing fs_struct +acrosss processes in different user namespaces. We already disallow +other forms of threading when unsharing a user namespace so this +should be no real burden in practice. + +This updates setns, clone, and unshare to disallow multiple user +namespaces sharing an fs_struct. + +Signed-off-by: "Eric W. Biederman" +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/fork.c | 5 ++++- + kernel/user_namespace.c | 4 ++++ + 2 files changed, 8 insertions(+), 1 deletion(-) + +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -1141,6 +1141,9 @@ static struct task_struct *copy_process( + if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS)) + return ERR_PTR(-EINVAL); + ++ if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) ++ return ERR_PTR(-EINVAL); ++ + /* + * Thread groups must share signals as well, and detached threads + * can only be started up within the thread group. +@@ -1801,7 +1804,7 @@ SYSCALL_DEFINE1(unshare, unsigned long, + * If unsharing a user namespace must also unshare the thread. + */ + if (unshare_flags & CLONE_NEWUSER) +- unshare_flags |= CLONE_THREAD; ++ unshare_flags |= CLONE_THREAD | CLONE_FS; + /* + * If unsharing a pid namespace must also unshare the thread. + */ +--- a/kernel/user_namespace.c ++++ b/kernel/user_namespace.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + static struct kmem_cache *user_ns_cachep __read_mostly; + +@@ -803,6 +804,9 @@ static int userns_install(struct nsproxy + if (atomic_read(¤t->mm->mm_users) > 1) + return -EINVAL; + ++ if (current->fs->users != 1) ++ return -EINVAL; ++ + if (!ns_capable(user_ns, CAP_SYS_ADMIN)) + return -EPERM; +