Thread (8 messages) 8 messages, 4 authors, 2022-09-29

RE: setns() affecting other threads in 5.10.132 and 6.0

From: David Laight <hidden>
Date: 2022-09-06 10:51:17
Also in: stable

From: Alexey Dobriyan
Sent: 05 September 2022 18:33
quoted
quoted
-----Original Message-----
From: David Laight <redacted>
Sent: 04 September 2022 15:05

Sometime after 5.10.105 (5.10.132 and 6.0) there is a change that
makes setns(open("/proc/1/ns/net")) in the main process changes
the behaviour of other process threads.
Not again...
I've realised what is going on.
It really isn't obvious at all.
Quite possibly the last change did fix it - even though
it broke our code.

/proc/net is a symlink to /proc/self/net.
But that isn't what the code wants to open.
What it needs is /proc/self/task/self/net.
But there isn't a 'self' in /proc/self/task.
Which makes it all a bit tedious (especially without gettid() in glibc).
(This is a busybox/buildroot system, maybe I could add it!)

I'd probably have noticed earlier if the /proc/net
symlink didn't exist.
I guess that is for compatibility with pre-netns kernels.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help