netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Alexey Dobriyan' <adobriyan@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: RE: setns() affecting other threads in 5.10.132 and 6.0
Date: Tue, 6 Sep 2022 10:48:16 +0000	[thread overview]
Message-ID: <6204a74ef41a4463a790962d0409d0bc@AcuMS.aculab.com> (raw)
In-Reply-To: <YxYytPTFwYr7vBTo@localhost.localdomain>

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

  parent reply	other threads:[~2022-09-06 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-04 14:05 setns() affecting other threads in 5.10.132 and 6.0 David Laight
2022-09-05  7:11 ` Greg KH
2022-09-05  9:54 ` David Laight
2022-09-05 17:32   ` Alexey Dobriyan
2022-09-06  8:25     ` David Laight
2022-09-06 10:48     ` David Laight [this message]
2022-09-29  9:33       ` setns() affecting other threads in 5.10.132 and 6.0 #forregzbot Thorsten Leemhuis
2022-09-05 10:32 ` setns() affecting other threads in 5.10.132 and 6.0 Thorsten Leemhuis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6204a74ef41a4463a790962d0409d0bc@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).