Re: [PATCH 1/4] landlock: Distinguish namespace creation and entry denials

From
sashiko-bot@kernel.org
Date
2026-11-17 10:29:24
Reply to
Mickaël Salaün, 2026-11-17
Landlock reports denied namespace creation and entry with the same
internal request type.  Before commit 08471914d6bb ("ns: allocate the
namespace id before the namespace_init hook"), denied creation carried
ID zero and could be distinguished from entry by ID alone.  That commit
moved ID allocation before namespace_init(), so creation now carries the
ID of an unreachable new namespace while entry carries the existing
target ID.  Namespace IDs are object context, not operation
discriminators.

Split the request type into creation and entry.  Keep the two namespace
values together before capability; this renumbers the unreleased
capability request in raw and typed trace context.  Report
namespace_op=create or namespace_op=enter immediately after blockers in
namespace audit records and trace event text.  Placing the operation
before namespace_type and namespace_id lets consumers establish the
semantics before interpreting the following namespace context,
especially whether namespace_id is the creation-time value or identifies
an existing entry target.

Keep namespace.use as the policy blocker: the new value only describes
the semantic hook context and does not add a policy control.

The creation value covers namespace_init(), including clone(2),
clone3(2), unshare(2), open_tree(2), and fsmount(2) paths.  The entry
value covers namespace_install(), currently reached through setns(2).

Cc: Günther Noack <gnoack@google.com>
Fixes: 15dd86021b57 ("landlock: Enforce namespace use restrictions")
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117102110.2524197-1-mic@digikod.net?part=1
Thread (9 messages) 9 messages, 2 authors, last reply 18h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help