mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 07:21:27 +00:00
userns: Restrict when proc and sysfs can be mounted
Only allow unprivileged mounts of proc and sysfs if they are already mounted when the user namespace is created. proc and sysfs are interesting because they have content that is per namespace, and so fresh mounts are needed when new namespaces are created while at the same time proc and sysfs have content that is shared between every instance. Respect the policy of who may see the shared content of proc and sysfs by only allowing new mounts if there was an existing mount at the time the user namespace was created. In practice there are only two interesting cases: proc and sysfs are mounted at their usual places, proc and sysfs are not mounted at all (some form of mount namespace jail). Cc: stable@vger.kernel.org Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
a636b702ed
commit
87a8ebd637
6 changed files with 37 additions and 0 deletions
|
@ -26,6 +26,8 @@ struct user_namespace {
|
|||
kuid_t owner;
|
||||
kgid_t group;
|
||||
unsigned int proc_inum;
|
||||
bool may_mount_sysfs;
|
||||
bool may_mount_proc;
|
||||
};
|
||||
|
||||
extern struct user_namespace init_user_ns;
|
||||
|
@ -82,4 +84,6 @@ static inline void put_user_ns(struct user_namespace *ns)
|
|||
|
||||
#endif
|
||||
|
||||
void update_mnt_policy(struct user_namespace *userns);
|
||||
|
||||
#endif /* _LINUX_USER_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue