[PATCH 4/6] selftests/landlock: Test POSIX message queue scoping

Mickaël Salaün mic at digikod.net
Tue Jul 28 11:04:10 UTC 2026


These tests are good, but related audit (and quiet) tests are missing.

A test should check the mqueue unlink.

A test should check that once the sandboxed process that created an
mqueue file exits, a new sibling or child sandboxed process cannot
access this (stale) mqueue, but a parent sandboxed process should still
be allowed to do so as well as for an unsandboxed process.

On Wed, Jul 22, 2026 at 01:29:40PM +0100, Oxana Kharitonova wrote:
> Add tests for LANDLOCK_SCOPE_POSIX_MSG_QUEUE.
> 
> Verify that opening a queue created outside the current scoped domain is
> denied, and that opening a queue created within the same domain remains
> allowed.
> 
> Signed-off-by: Oxana Kharitonova <oxana at cloudflare.com>
> ---
>  .../landlock/scoped_posix_msg_queue_test.c    | 223 ++++++++++++++++++
>  .../testing/selftests/landlock/scoped_test.c  |   2 +-
>  2 files changed, 224 insertions(+), 1 deletion(-)
>  create mode 100644 tools/testing/selftests/landlock/scoped_posix_msg_queue_test.c
> 
> diff --git a/tools/testing/selftests/landlock/scoped_posix_msg_queue_test.c b/tools/testing/selftests/landlock/scoped_posix_msg_queue_test.c
> new file mode 100644
> index 000000000000..602ba5c7a83d
> --- /dev/null
> +++ b/tools/testing/selftests/landlock/scoped_posix_msg_queue_test.c
> @@ -0,0 +1,223 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Landlock tests - POSIX message queue scoping
> + *
> + * Copyright © 2024-2026 Microsoft Corporation

You need to update that.



More information about the Linux-security-module-archive mailing list