Skip to content
Snippets Groups Projects
Commit ab81dabd authored by Al Viro's avatar Al Viro
Browse files

fix sysfs_init_fs_context() in !CONFIG_NET_NS case


Permission checks on current's netns should be done only when
netns are enabled.

Reported-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Fixes: 23bf1b6b
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c99c2171
No related branches found
No related tags found
No related merge requests found
......@@ -71,9 +71,11 @@ static int sysfs_init_fs_context(struct fs_context *fc)
kfc->magic = SYSFS_MAGIC;
fc->fs_private = kfc;
fc->ops = &sysfs_fs_context_ops;
if (fc->user_ns)
put_user_ns(fc->user_ns);
fc->user_ns = get_user_ns(netns->user_ns);
if (netns) {
if (fc->user_ns)
put_user_ns(fc->user_ns);
fc->user_ns = get_user_ns(netns->user_ns);
}
fc->global = true;
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment