From: "Günther Noack" <gnoack@google.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-security-module@vger.kernel.org,
"Micka??l Sala??n" <mic@digikod.net>,
Tahera Fahimi <fahimitahera@gmail.com>,
Tanya Agarwal <tanyaagarwal25699@gmail.com>,
linux-man@vger.kernel.org
Subject: Re: [PATCH 2/2] landlock: Clarify IPC scoping documentation
Date: Wed, 26 Feb 2025 20:52:03 +0000 [thread overview]
Message-ID: <Z79-87HoTPM94HWf@google.com> (raw)
In-Reply-To: <erjborzfvlvlczeahjt7esghr4v3slgxdht6efftekofxljhiq@mkw2ibzvpvsx>
Hello Alejandro!
On Sun, Feb 02, 2025 at 01:51:54PM +0100, Alejandro Colomar wrote:
> On Fri, Jan 24, 2025 at 04:59:29PM +0100, G??nther Noack wrote:
> > On Fri, Jan 24, 2025 at 03:44:45PM +0000, G??nther Noack wrote:
> > > -IPC scoping does not support exceptions, so if a domain is scoped, no rules can
> > > -be added to allow access to resources or processes outside of the scope.
> > > +interactions between sandboxes. Therefore, at ruleset creation time, each
> > > +Landlock domain can restrict the scope for certain operations, so that these
> > > +operations can only reach out to processes within the same Landlock domain or in
> > > +a nested Landlock domain (the "scope").
> > > +
> > > +The operations which can be scoped are:
> > > +
> > > +``LANDLOCK_SCOPE_SIGNAL``
> > > + When set,
>
> Do we need to say when set? I'd say that's redundant (of course if you
> don't set a flag, its effects don't apply).
Removed, thanks!
> > > this limits the sending of signals to target processes which run
> > > + within the same or a nested Landlock domain.
> > > +
> > > +``LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET``
> > > + When set, this limits the set of abstract :manpage:`unix(7)` sockets we can
> > > + :manpage:`connect(2)` to to socket addresses which were created by a process
> > > + in the same or a nested Landlock domain.
> > > +
> > > + A :manpage:`send(2)` on a non-connected datagram socket is treated like an
> > > + implicit :manpage:`connect(2)` and will be blocked when the remote end does
>
> I think *if* would be more appropriate than *when* here.
>
> > > + not stem from the same or a nested Landlock domain.
>
> This could be read such that send(2) is replaced by connect(2) on a
> non-connected datagram socket. But you want to say that a connect(2)
> is implicitly executed before the actual send(2) (which is still
> executed, if connect(2) succeeds).
Thanks, that can indeed be misunderstood.
> How about this wording?
>
> If send(2) is used on a non-connected datagram socket, an
> implicit connect(2) is executed first, and will be blocked when
> the remote end does not ....
I think this would be misleading as well, because the send(2) on the
non-connected datagram socket does *not* actually perform an implicit
connect(2). (If it were doing that, the socket would be connected afterwards,
but it isn't.) But we *do* initiate a communication with a previously unknown
remote address, just like connect(2), so we enforce the same Landlock policy as
for connect(2).
(Remark, connected datagram sockets sound absurd, because there is no connection
at the network layer. On datagram sockets, connect(2) only fixes the destination
address so that it can be omitted in subsequent send(2) calls.).
Rewording it to:
A sendto(2) on a non-connected datagram socket is treated as if
it were doing an implicit connect(2) and will be blocked if the
remote end does not stem from the same or a nested Landlock domain.
(P.S. I also replaced send(2) with sendto(2), which is a bit more appropriate in
the middle paragraph - you can not actually pass the destination address with
send(2), that only works with sendto(2). I replaced it in the third paragraph
as well for consistency. It still makes sense IMHO considering that send(2) is a
special case of sendto(2).)
—Günther
next prev parent reply other threads:[~2025-02-26 20:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250124154445.162841-1-gnoack@google.com>
[not found] ` <20250124154445.162841-2-gnoack@google.com>
2025-01-24 15:59 ` [PATCH 2/2] landlock: Clarify IPC scoping documentation Günther Noack
2025-02-02 12:51 ` Alejandro Colomar
2025-02-26 20:52 ` Günther Noack [this message]
2025-02-26 21:21 ` Alejandro Colomar
2025-02-11 15:20 ` Mickaël Salaün
2025-01-24 16:37 ` [PATCH man 1/3] landlock.7: Update description of Landlock rules Günther Noack
2025-01-24 16:37 ` [PATCH man 2/3] landlock.7: Move over documentation for ABI version 6 Günther Noack
2025-01-24 16:37 ` [PATCH man 3/3] landlock.7: Update wording in line with kernel side proposal Günther Noack
2025-02-11 15:17 ` [PATCH 1/2] landlock: Minor typo and grammar fixes in IPC scoping documentation Mickaël Salaün
2025-02-11 15:27 ` Alejandro Colomar
2025-02-11 15:53 ` Mickaël Salaün
2025-02-11 16:13 ` Alejandro Colomar
2025-02-11 18:08 ` G. Branden Robinson
2025-02-12 15:15 ` Alejandro Colomar
2025-02-11 19:24 ` Mickaël Salaün
2025-02-12 15:06 ` Alejandro Colomar
2025-02-26 20:24 ` Günther Noack
2025-02-26 20:57 ` Alejandro Colomar
2025-02-26 21:38 ` Günther Noack
2025-02-26 21:51 ` Alejandro Colomar
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=Z79-87HoTPM94HWf@google.com \
--to=gnoack@google.com \
--cc=alx@kernel.org \
--cc=fahimitahera@gmail.com \
--cc=linux-man@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=tanyaagarwal25699@gmail.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