Skip to content
Commit a1457a7b authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov
Browse files

sysctl: restore sysctls for correct namespaces



When we don't use userns, __userns_sysctl_op is called
in context of the current process. A mount namespaces is restored
the last one, so when we restore namespaces, we see /proc from the
host pid namespace. In this case we can't use virtual pid to access
/proc/pid.

Let's open /proc/self/ns and use this descriptor to switch namespaces.

Cc: Tycho Andersen <tycho.andersen@canonical.com>
Fixes: f79f4546 ("sysctl: move sysctl calls to usernsd")
Signed-off-by: default avatarAndrew Vagin <avagin@openvz.org>
Acked-by: default avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
parent 23573119
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment