diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 2 | ||||
-rw-r--r-- | kernel/fork.c | 21 | ||||
-rw-r--r-- | kernel/kmod.c | 2 | ||||
-rw-r--r-- | kernel/nsproxy.c | 16 |
4 files changed, 21 insertions, 20 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 6267a6cc6113..28d9feedfd27 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/completion.h> | 13 | #include <linux/completion.h> |
14 | #include <linux/personality.h> | 14 | #include <linux/personality.h> |
15 | #include <linux/tty.h> | 15 | #include <linux/tty.h> |
16 | #include <linux/namespace.h> | 16 | #include <linux/mnt_namespace.h> |
17 | #include <linux/key.h> | 17 | #include <linux/key.h> |
18 | #include <linux/security.h> | 18 | #include <linux/security.h> |
19 | #include <linux/cpu.h> | 19 | #include <linux/cpu.h> |
diff --git a/kernel/fork.c b/kernel/fork.c index 60d2644bfe85..8c859eef8e6a 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/vmalloc.h> | 19 | #include <linux/vmalloc.h> |
20 | #include <linux/completion.h> | 20 | #include <linux/completion.h> |
21 | #include <linux/namespace.h> | 21 | #include <linux/mnt_namespace.h> |
22 | #include <linux/personality.h> | 22 | #include <linux/personality.h> |
23 | #include <linux/mempolicy.h> | 23 | #include <linux/mempolicy.h> |
24 | #include <linux/sem.h> | 24 | #include <linux/sem.h> |
@@ -1525,17 +1525,18 @@ static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp) | |||
1525 | } | 1525 | } |
1526 | 1526 | ||
1527 | /* | 1527 | /* |
1528 | * Unshare the namespace structure if it is being shared | 1528 | * Unshare the mnt_namespace structure if it is being shared |
1529 | */ | 1529 | */ |
1530 | static int unshare_namespace(unsigned long unshare_flags, struct namespace **new_nsp, struct fs_struct *new_fs) | 1530 | static int unshare_mnt_namespace(unsigned long unshare_flags, |
1531 | struct mnt_namespace **new_nsp, struct fs_struct *new_fs) | ||
1531 | { | 1532 | { |
1532 | struct namespace *ns = current->nsproxy->namespace; | 1533 | struct mnt_namespace *ns = current->nsproxy->mnt_ns; |
1533 | 1534 | ||
1534 | if ((unshare_flags & CLONE_NEWNS) && ns) { | 1535 | if ((unshare_flags & CLONE_NEWNS) && ns) { |
1535 | if (!capable(CAP_SYS_ADMIN)) | 1536 | if (!capable(CAP_SYS_ADMIN)) |
1536 | return -EPERM; | 1537 | return -EPERM; |
1537 | 1538 | ||
1538 | *new_nsp = dup_namespace(current, new_fs ? new_fs : current->fs); | 1539 | *new_nsp = dup_mnt_ns(current, new_fs ? new_fs : current->fs); |
1539 | if (!*new_nsp) | 1540 | if (!*new_nsp) |
1540 | return -ENOMEM; | 1541 | return -ENOMEM; |
1541 | } | 1542 | } |
@@ -1623,7 +1624,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags) | |||
1623 | { | 1624 | { |
1624 | int err = 0; | 1625 | int err = 0; |
1625 | struct fs_struct *fs, *new_fs = NULL; | 1626 | struct fs_struct *fs, *new_fs = NULL; |
1626 | struct namespace *ns, *new_ns = NULL; | 1627 | struct mnt_namespace *ns, *new_ns = NULL; |
1627 | struct sighand_struct *new_sigh = NULL; | 1628 | struct sighand_struct *new_sigh = NULL; |
1628 | struct mm_struct *mm, *new_mm = NULL, *active_mm = NULL; | 1629 | struct mm_struct *mm, *new_mm = NULL, *active_mm = NULL; |
1629 | struct files_struct *fd, *new_fd = NULL; | 1630 | struct files_struct *fd, *new_fd = NULL; |
@@ -1645,7 +1646,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags) | |||
1645 | goto bad_unshare_out; | 1646 | goto bad_unshare_out; |
1646 | if ((err = unshare_fs(unshare_flags, &new_fs))) | 1647 | if ((err = unshare_fs(unshare_flags, &new_fs))) |
1647 | goto bad_unshare_cleanup_thread; | 1648 | goto bad_unshare_cleanup_thread; |
1648 | if ((err = unshare_namespace(unshare_flags, &new_ns, new_fs))) | 1649 | if ((err = unshare_mnt_namespace(unshare_flags, &new_ns, new_fs))) |
1649 | goto bad_unshare_cleanup_fs; | 1650 | goto bad_unshare_cleanup_fs; |
1650 | if ((err = unshare_sighand(unshare_flags, &new_sigh))) | 1651 | if ((err = unshare_sighand(unshare_flags, &new_sigh))) |
1651 | goto bad_unshare_cleanup_ns; | 1652 | goto bad_unshare_cleanup_ns; |
@@ -1686,8 +1687,8 @@ asmlinkage long sys_unshare(unsigned long unshare_flags) | |||
1686 | } | 1687 | } |
1687 | 1688 | ||
1688 | if (new_ns) { | 1689 | if (new_ns) { |
1689 | ns = current->nsproxy->namespace; | 1690 | ns = current->nsproxy->mnt_ns; |
1690 | current->nsproxy->namespace = new_ns; | 1691 | current->nsproxy->mnt_ns = new_ns; |
1691 | new_ns = ns; | 1692 | new_ns = ns; |
1692 | } | 1693 | } |
1693 | 1694 | ||
@@ -1748,7 +1749,7 @@ bad_unshare_cleanup_sigh: | |||
1748 | 1749 | ||
1749 | bad_unshare_cleanup_ns: | 1750 | bad_unshare_cleanup_ns: |
1750 | if (new_ns) | 1751 | if (new_ns) |
1751 | put_namespace(new_ns); | 1752 | put_mnt_ns(new_ns); |
1752 | 1753 | ||
1753 | bad_unshare_cleanup_fs: | 1754 | bad_unshare_cleanup_fs: |
1754 | if (new_fs) | 1755 | if (new_fs) |
diff --git a/kernel/kmod.c b/kernel/kmod.c index 8d2bea09a4ec..3a7379aa31ca 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/kmod.h> | 25 | #include <linux/kmod.h> |
26 | #include <linux/smp_lock.h> | 26 | #include <linux/smp_lock.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/namespace.h> | 28 | #include <linux/mnt_namespace.h> |
29 | #include <linux/completion.h> | 29 | #include <linux/completion.h> |
30 | #include <linux/file.h> | 30 | #include <linux/file.h> |
31 | #include <linux/workqueue.h> | 31 | #include <linux/workqueue.h> |
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c index 674aceb7335a..bd9cb435dfe0 100644 --- a/kernel/nsproxy.c +++ b/kernel/nsproxy.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/version.h> | 17 | #include <linux/version.h> |
18 | #include <linux/nsproxy.h> | 18 | #include <linux/nsproxy.h> |
19 | #include <linux/init_task.h> | 19 | #include <linux/init_task.h> |
20 | #include <linux/namespace.h> | 20 | #include <linux/mnt_namespace.h> |
21 | #include <linux/utsname.h> | 21 | #include <linux/utsname.h> |
22 | 22 | ||
23 | struct nsproxy init_nsproxy = INIT_NSPROXY(init_nsproxy); | 23 | struct nsproxy init_nsproxy = INIT_NSPROXY(init_nsproxy); |
@@ -60,8 +60,8 @@ struct nsproxy *dup_namespaces(struct nsproxy *orig) | |||
60 | struct nsproxy *ns = clone_namespaces(orig); | 60 | struct nsproxy *ns = clone_namespaces(orig); |
61 | 61 | ||
62 | if (ns) { | 62 | if (ns) { |
63 | if (ns->namespace) | 63 | if (ns->mnt_ns) |
64 | get_namespace(ns->namespace); | 64 | get_mnt_ns(ns->mnt_ns); |
65 | if (ns->uts_ns) | 65 | if (ns->uts_ns) |
66 | get_uts_ns(ns->uts_ns); | 66 | get_uts_ns(ns->uts_ns); |
67 | if (ns->ipc_ns) | 67 | if (ns->ipc_ns) |
@@ -97,7 +97,7 @@ int copy_namespaces(int flags, struct task_struct *tsk) | |||
97 | 97 | ||
98 | tsk->nsproxy = new_ns; | 98 | tsk->nsproxy = new_ns; |
99 | 99 | ||
100 | err = copy_namespace(flags, tsk); | 100 | err = copy_mnt_ns(flags, tsk); |
101 | if (err) | 101 | if (err) |
102 | goto out_ns; | 102 | goto out_ns; |
103 | 103 | ||
@@ -117,8 +117,8 @@ out_ipc: | |||
117 | if (new_ns->uts_ns) | 117 | if (new_ns->uts_ns) |
118 | put_uts_ns(new_ns->uts_ns); | 118 | put_uts_ns(new_ns->uts_ns); |
119 | out_uts: | 119 | out_uts: |
120 | if (new_ns->namespace) | 120 | if (new_ns->mnt_ns) |
121 | put_namespace(new_ns->namespace); | 121 | put_mnt_ns(new_ns->mnt_ns); |
122 | out_ns: | 122 | out_ns: |
123 | tsk->nsproxy = old_ns; | 123 | tsk->nsproxy = old_ns; |
124 | kfree(new_ns); | 124 | kfree(new_ns); |
@@ -127,8 +127,8 @@ out_ns: | |||
127 | 127 | ||
128 | void free_nsproxy(struct nsproxy *ns) | 128 | void free_nsproxy(struct nsproxy *ns) |
129 | { | 129 | { |
130 | if (ns->namespace) | 130 | if (ns->mnt_ns) |
131 | put_namespace(ns->namespace); | 131 | put_mnt_ns(ns->mnt_ns); |
132 | if (ns->uts_ns) | 132 | if (ns->uts_ns) |
133 | put_uts_ns(ns->uts_ns); | 133 | put_uts_ns(ns->uts_ns); |
134 | if (ns->ipc_ns) | 134 | if (ns->ipc_ns) |