All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Oxana Kharitonova <oxana@cloudflare.com>
Cc: gnoack@google.com, paul@paul-moore.com, serge@hallyn.com,
	 wangyan01@kylinos.cn, linux-security-module@vger.kernel.org,
	 linux-kernel@vger.kernel.org, landlock@lists.linux.dev,
	webprosto@gmail.com,  kernel-team@cloudflare.com,
	Christian Brauner <brauner@kernel.org>,
	 Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 0/6] landlock: Add POSIX message queue scoping
Date: Tue, 28 Jul 2026 13:02:57 +0200	[thread overview]
Message-ID: <20260728.Heephie1tai3@digikod.net> (raw)
In-Reply-To: <20260722122952.42149-1-oxana@cloudflare.com>

Hi Oxana,

Thanks for this patch series.  Overall it looks good but you'll find
some feedback to improve and send a v2, following Günther's and Justin's
ones.

You should also Cc Christian and Al and ask for a review of the
mqueue-specific patches (e.g. patch 1) for v2.

You'll find AI reviews here:
https://sashiko.dev/#/patchset/20260722122952.42149-1-oxana%40cloudflare.com

A test should create a domain that denies LANDLOCK_ACCESS_FS_READ_FILE
and make sure the msgqueue scoping control stays the same.

The question about unlinking mqueue is a bit tricky.  I don't think this
should be restricted by an mqueue scope because that would mean that a
sandboxed process creating an mqueue would not be able to remove the
next time the same sandboxed program tries to clean up its files.  So,
we should check if such file are automatically removed if its creator
exits.  In any case, this should at least be documented in the user
documentation.

The user doc should explain this new scope (see previous scope addition
for examples).

tools/testing/selftests/landlock/config must be updated with
CONFIG_POSIX_MQUEUE=y

Other questions/comments should either be answered to explain why they
don't make sense or otherwise be implemented with v2.


On Wed, Jul 22, 2026 at 01:29:36PM +0100, Oxana Kharitonova wrote:
> Hi,
> 
> This series adds landlock support for scoping POSIX message queuesi [1].

Nit: Landlock (in all docs, comments, and messages).

>  
> Landlock already supports scoped IPC restrictions for signals and abstract
> UNIX sockets. These restrictions make it possible to prevent a sandboxed
> task from interacting with IPC objects outside of its Landlock domain,
> while still allowing communication within the same domain or with nested
> domains.
>  
> This series extends the same model to POSIX message queues with a new
> LANDLOCK_SCOPE_POSIX_MSG_QUEUE scope. When this scope is enforced, a task
> can only open POSIX message queues that were created by a task in the same
> landlock domain or in a nested domain.
>  
> The implementation tags mqueuefs inodes at creation time with the creator's
> landlock domain. This domain is kept alive for the lifetime of the inode
> and is checked when the queue is opened.
>  
> The series also exposes the mqueuefs magic number through the shared UAPI
> magic header, bumps the Landlock ABI, updates documentation, adds sandboxer
> support, and adds selftests.
>  
> The new behavior is:
>  
> - a task restricted with LANDLOCK_SCOPE_POSIX_MSG_QUEUE cannot open a queue
>   created outside of its Landlock scope;
> - a task can still open a queue created within its own Landlock domain;
> - queues created outside of any Landlock domain are treated as outside the
>   scope for a scoped opener.
> 
> [1] https://man7.org/linux/man-pages/man7/mq_overview.7.html
> 
> Oxana Kharitonova (6):
>   ipc: Move mqueue fs magic to uapi magic header
>   landlock: Scope POSIX message queue opens
>   landlock: Bump ABI for LANDLOCK_SCOPE_POSIX_MSG_QUEUE
>   selftests/landlock: Test POSIX message queue scoping
>   samples/landlock: Support POSIX message queue scoping
>   landlock: Document POSIX message queue scoping
> 
>  Documentation/admin-guide/LSM/landlock.rst    |   6 +-
>  Documentation/userspace-api/landlock.rst      |  11 +-
>  include/uapi/linux/landlock.h                 |   7 +-
>  include/uapi/linux/magic.h                    |   2 +
>  ipc/mqueue.c                                  |   2 +-
>  samples/landlock/sandboxer.c                  |  16 +-
>  security/landlock/audit.c                     |   9 +
>  security/landlock/audit.h                     |   1 +
>  security/landlock/fs.c                        |  35 +++
>  security/landlock/fs.h                        |  15 ++
>  security/landlock/limits.h                    |   2 +-
>  security/landlock/ruleset.c                   |   1 -
>  security/landlock/syscalls.c                  |   2 +-
>  security/landlock/task.c                      |  43 ++++
>  security/landlock/task.h                      |   4 +
>  tools/testing/selftests/landlock/base_test.c  |   2 +-
>  .../landlock/scoped_posix_msg_queue_test.c    | 223 ++++++++++++++++++
>  .../testing/selftests/landlock/scoped_test.c  |   2 +-
>  18 files changed, 371 insertions(+), 12 deletions(-)
>  create mode 100644 tools/testing/selftests/landlock/scoped_posix_msg_queue_test.c
> 
> -- 
> 2.50.1 (Apple Git-155)
> 
> 

      parent reply	other threads:[~2026-07-28 11:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 12:29 [PATCH 0/6] landlock: Add POSIX message queue scoping 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 ` Mickaël Salaün [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=20260728.Heephie1tai3@digikod.net \
    --to=mic@digikod.net \
    --cc=brauner@kernel.org \
    --cc=gnoack@google.com \
    --cc=kernel-team@cloudflare.com \
    --cc=landlock@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=oxana@cloudflare.com \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wangyan01@kylinos.cn \
    --cc=webprosto@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.