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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alexey Dobriyan
> Sent: 05 September 2022 18:33
> > > -----Original Message-----
> > > From: David Laight <David.Laight@xxxxxxxxxx>
> > > 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)




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux