sysctl: restore sysctls for correct namespaces
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 <10c18fcb898ee6b17d6575d444b125d10b3f4d6a@canonical.com>
Fixes: f79f4546cfc0 ("sysctl: move sysctl calls to usernsd")
Signed-off-by: Andrew Vagin <74c05afa918858348d6db8037d82fa8124870113@openvz.org>
Acked-by: Tycho Andersen <10c18fcb898ee6b17d6575d444b125d10b3f4d6a@canonical.com>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

eabatalov/criu,tych0/criu,wtf42/criu,wtf42/criu,eabatalov/criu,svloyso/criu,eabatalov/criu,svloyso/criu,tych0/criu,fbocharov/criu,AuthenticEshkinKot/criu,AuthenticEshkinKot/criu,ldu4/criu,tych0/criu,svloyso/criu,efiop/criu,AuthenticEshkinKot/criu,fbocharov/criu,wtf42/criu,efiop/criu,AuthenticEshkinKot/criu,ldu4/criu,efiop/criu,efiop/criu,efiop/criu,wtf42/criu,eabatalov/criu,svloyso/criu,wtf42/criu,wtf42/criu,KKoukiou/criu-remote,eabatalov/criu,AuthenticEshkinKot/criu,eabatalov/criu,AuthenticEshkinKot/criu,ldu4/criu,ldu4/criu,KKoukiou/criu-remote,svloyso/criu,svloyso/criu,KKoukiou/criu-remote,fbocharov/criu,fbocharov/criu,KKoukiou/criu-remote,fbocharov/criu,ldu4/criu,tych0/criu,KKoukiou/criu-remote,tych0/criu,KKoukiou/criu-remote,efiop/criu,fbocharov/criu,tych0/criu,ldu4/criu