From: Oxana Kharitonova <webprosto@gmail.com>
To: webprosto@gmail.com
Cc: gnoack3000@gmail.com, gnoack@google.com, jmorris@namei.or,
landlock@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, mic@digikod.net,
oxana@cloudflare.com, paul@paul-moore.com, serge@hallyn.com,
wangyan01@kylinos.cn, utilityemal77@gmail.com
Subject: Re: [PATCH 0/6] landlock: Add POSIX message queue scoping
Date: Mon, 28 Sep 2026 16:47:34 +0100 [thread overview]
Message-ID: <20260928155002.742984-1-webprosto@gmail.com> (raw)
In-Reply-To: <20260914141156.258282-1-webprosto@gmail.com>
Hi Günther!
As promissed, I'm following up with a more complete answer.
On 14/09/2026 15:10, Oxana Kharitonova wrote:
> On 21/08/2026 09:46, Günther Noack wrote:
>> What *might* still be interesting to restrict though: While mq_open()
>> checks the READ_FILE and WRITE_FILE rights, it checks none of the
>> LANDLOCK_ACCESS_FS_MAKE_* rights -- the message queue gets still
>> created, even when the mq_open() is denied and returns with an error.
I revisited my changes and noticed the gap you mentioned regarding
mqueue creation. Thanks for highlighting it. I'll address it in v2.
>> To expand on Justin's comment in [1] -- it feels that there are maybe
>> still some gaps in the "lifecycle management" of these message queues
>> that might be worth thinking systematically about, because both
>> mq_unlink() and the creation of the message queue entries are
>> currently apparently not restrictable yet? It makes me wonder whether
>> hijacking of message queue names (creating same-named queues in other
>> Landlock domains) is a problem then? Do you have thoughts on this?
>
> I need to think about it more and check how the mq_unlink works, taking
> into account the comment from Justin and Mickaël.
> I'll follow up with a more complete answer.
Regarding the lifecycle management of POSIX message queues, I haven’t
found a good solution yet. I experimented with test programs, but the
main constraints come from the POSIX message-queue semantics. A queue is
independent of its creator’s lifetime and remains until mq_unlink() is
called explicitly and all open descriptors are closed. Its name must be
unique within the IPC namespace, but the same name can be reused after
the existing queue has been unlinked.
If mq_unlink() is restricted for a process, a stale queue could remain
and that process might be unable to clean it up. This seems to be the
concern Mickaël raised in [2]. However, Landlock restrictions apply to
the restricted process or domain, rather than globally to the queue, so
another process might still be able to access or unlink it if its
permissions allow. Therefore, I don’t currently see how to restrict this
correctly through a Landlock policy, other than documenting the
limitation. Let me know if you have other thoughts or I'm missing
something.
>>
>> Thanks,
>> –Günther
>>
>> [1] https://lore.kernel.org/all/amKDYoOSvHMzVbKX@suesslenovo/
Thanks,
Oxana
[2] https://lore.kernel.org/all/20260728.Heephie1tai3@digikod.net/
prev parent reply other threads:[~2026-09-28 15:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 12:29 Oxana Kharitonova
2026-07-22 12:29 ` [PATCH 1/6] ipc: Move mqueue fs magic to uapi magic header Oxana Kharitonova
2026-07-22 12:43 ` Günther Noack
2026-07-22 15:14 ` Oxana Kharitonova
2026-07-22 12:29 ` [PATCH 2/6] landlock: Scope POSIX message queue opens Oxana Kharitonova
2026-07-23 21:59 ` Justin Suess
2026-07-28 11:03 ` Mickaël Salaün
2026-07-22 12:29 ` [PATCH 3/6] landlock: Bump ABI for LANDLOCK_SCOPE_POSIX_MSG_QUEUE Oxana Kharitonova
2026-07-28 11:03 ` Mickaël Salaün
2026-07-22 12:29 ` [PATCH 4/6] selftests/landlock: Test POSIX message queue scoping Oxana Kharitonova
2026-07-28 11:04 ` Mickaël Salaün
2026-07-22 12:29 ` [PATCH 5/6] samples/landlock: Support " Oxana Kharitonova
2026-07-28 11:04 ` Mickaël Salaün
2026-07-22 12:29 ` [PATCH 6/6] landlock: Document " Oxana Kharitonova
2026-07-28 11:02 ` [PATCH 0/6] landlock: Add " Mickaël Salaün
2026-07-29 12:43 ` Oxana Kharitonova
2026-08-21 8:46 ` Günther Noack
2026-09-14 14:10 ` Oxana Kharitonova
2026-09-28 15:47 ` Oxana Kharitonova [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=20260928155002.742984-1-webprosto@gmail.com \
--to=webprosto@gmail.com \
--cc=gnoack3000@gmail.com \
--cc=gnoack@google.com \
--cc=jmorris@namei.or \
--cc=landlock@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=oxana@cloudflare.com \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
--cc=utilityemal77@gmail.com \
--cc=wangyan01@kylinos.cn \
/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®