mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Justin Suess <utilityemal77@gmail.com>
To: "Günther Noack" <gnoack3000@gmail.com>
Cc: mic@digikod.net, linux-kernel@vger.kernel.org,
	 linux-security-module@vger.kernel.org
Subject: Re: [PATCH v2 3/6] landlock: Bump ABI for LANDLOCK_SCOPE_SYSV_MSG_QUEUE
Date: Fri, 21 Aug 2026 10:31:51 -0400	[thread overview]
Message-ID: <aohfGjG15BUfOY7X@zenbox> (raw)
In-Reply-To: <aohKoD4GqIFR4ni4@zenbox>

On Fri, Aug 21, 2026 at 09:15:31AM -0400, Justin Suess wrote:
> On Fri, Aug 21, 2026 at 02:38:15PM +0200, Günther Noack wrote:
> > On Mon, Jul 27, 2026 at 07:08:30PM -0400, Justin Suess wrote:
> > > Bump the ABI version for Landlock SysV message queue scoping.
> > > 
> > > Signed-off-by: Justin Suess <utilityemal77@gmail.com>
> > 
> > The ABI bump is normally put into the same commit as the
> > implementation for easier backporting. Otherwise, looks good.
> I'll squash them.
> 
> >
> Thanks,
> 
> I did wonder about if we need to use the landlock_object here?
> 
> I'm pretty sure SysV message queues stay open after process exit,
> which could cause the domain to be pinned by landlock_cred_security,
> if programs are lazy and don't close them.
> 
> So it probably needs to be a weak reference. 
> 
> But it's unclear what should be the behavior there when the domain
> is dropped:
> 
> 1. Should it become inaccessible and belong to *nobody's* domain?
> 
> (i.e when owning domain is dropped, the queue belongs to no domain and is inaccessible to
> all LANDLOCK_SCOPE_SYSV_MSG_QUEUE scoped domains)
> 
> 2. Should it be moved to the parent's domain?
> 
> (i.e when owning domain is dropped, the parent domain is the new scope,
> and then it's parent, so on and so forth, more complicated, but more correct)
> 
> 3. Or be kept as is.
> 
> (i.e Allow an open sysv message queue to pin a domain
> for it's lifetime)
>
Scratch all of this, I think it's best if the kern_ipc_blob takes a reference to
the landlock_hierarchy plus a depth u16.

I think this will require introducing a new
landlock_put_hierarchy_deferred method because of the runtime context of
the ipc hooks, but should be pretty easy.

Also refactor domain_is_scoped() to take the server side as (hierarchy, depth).

Justin
> Either way this almost certainly needs to be rebased since it's been
> a little bit and there were significant refactorings of the domain and
> ruleset structures since the tracepoints series.
> 
> Justin
> 
> > –Günther

  reply	other threads:[~2026-08-21 14:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 23:08 [PATCH v2 0/6] landlock: Add scoped access bit for SysV message queues Justin Suess
2026-07-27 23:08 ` [PATCH v2 1/6] landlock: Add kern_ipc_perm credential blob structs Justin Suess
2026-07-27 23:08 ` [PATCH v2 2/6] landlock: Add LANDLOCK_SCOPE_SYSV_MSG_QUEUE Justin Suess
2026-07-27 23:08 ` [PATCH v2 3/6] landlock: Bump ABI for LANDLOCK_SCOPE_SYSV_MSG_QUEUE Justin Suess
2026-08-21 12:38   ` Günther Noack
2026-08-21 13:15     ` Justin Suess
2026-08-21 14:31       ` Justin Suess [this message]
2026-07-27 23:08 ` [PATCH v2 4/6] selftests/landlock: Test LANDLOCK_SCOPE_SYSV_MSG_QUEUE Justin Suess
2026-08-22  9:44   ` Günther Noack
2026-07-27 23:08 ` [PATCH v2 5/6] samples/landlock: Support LANDLOCK_SCOPE_SYSV_MSG_QUEUE in sandboxer Justin Suess
2026-07-27 23:08 ` [PATCH v2 6/6] landlock: Document LANDLOCK_SCOPE_SYSV_MSG_QUEUE Justin Suess
2026-08-22 17:26 ` [PATCH v2 0/6] landlock: Add scoped access bit for SysV message queues Günther Noack
2026-08-22 21:13   ` Günther Noack
2026-08-22 21:51     ` Justin Suess
2026-08-23 22:21       ` Günther Noack
2026-08-24  6:36       ` Günther Noack
2026-08-24 12:47         ` Justin Suess
2026-08-24 16:03           ` Günther Noack

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=aohfGjG15BUfOY7X@zenbox \
    --to=utilityemal77@gmail.com \
    --cc=gnoack3000@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    /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

all inboxes | Powered by JetHome®