netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Lunn <andrew@lunn.ch>
Cc: Donald Sharp <sharpd@cumulusnetworks.com>,
	netdev@vger.kernel.org, David Ahern <dsa@cumulusnetworks.com>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Roopa Prabhu <roopa@cumulusnetworks.com>
Subject: Re: AF_UNIX sockets crossing namespace based boundaries
Date: Thu, 17 Jan 2019 22:47:21 -0600	[thread overview]
Message-ID: <871s5ashba.fsf@xmission.com> (raw)
In-Reply-To: <20190102160221.GB2446@lunn.ch> (Andrew Lunn's message of "Wed, 2 Jan 2019 17:02:21 +0100")

Andrew Lunn <andrew@lunn.ch> writes:

> On Wed, Jan 02, 2019 at 10:22:36AM -0500, Donald Sharp wrote:
>> I am only creating a network namespace, but I don't think this changes
>> my core question.
>> 
>> Suppose I am running FRR/zebra in the default namespace and I startup
>> a BGP instance in namespace one.  BGP will connect to the default
>> namespaces zebra instance.
>
> Hi David.
>
> We are talking about AF_UNIX here. By default, the name of the socket
> is a path on a filesystem. So to me, netns plays no role here when you
> reference the socket via its filesystem name. The path exists in the
> filesystem namespace, and in your case with only netns, the same path
> exists in all your netns.
>
> Linux has multiple namespaces, which in theory should be
> orthogonal. However in practice, they do sometime overlap, and this is
> one example. There are other examples, /proc files are also netns
> unaware. It seems like having an object depend on two different
> namespaces at the same time is simply not supported.

To clarify.

It was a deliberate design choice to allow connecting to a af_unix
socket with a presence in a filesystem from other network namespaces.

We audited the code to ensure that, that case would work without
problems before actually allowing it.

Long story short.  If two processes can communicate through the
filesystem then we allow creating an af_unix socket in the filesystem
they can communicate through.

Eric

      reply	other threads:[~2019-01-18  4:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02  0:46 AF_UNIX sockets crossing namespace based boundaries Donald Sharp
2019-01-02 14:05 ` Andrew Lunn
2019-01-02 15:22   ` Donald Sharp
2019-01-02 16:02     ` Andrew Lunn
2019-01-18  4:47       ` Eric W. Biederman [this message]

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=871s5ashba.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=andrew@lunn.ch \
    --cc=dsa@cumulusnetworks.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=sharpd@cumulusnetworks.com \
    /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).