[PATCH 4/8] landlock: pass the namespace id to log to check_ns_type()

sashiko-bot at kernel.org sashiko-bot at kernel.org
Mon Oct 26 10:45:53 UTC 2026


> Landlock logs the namespace id when it denies the use of a namespace.
> check_ns_type() takes it from the namespace itself. When it is called
> from the namespace_init hook the id is always zero as it is only
> allocated after the hook has run.
> 
> A follow-up patch will allocate the id before the namespace_init hook is
> called. But a namespace whose creation is denied never becomes visible
> and the Landlock documentation says that namespace_id is zero for
> namespace creation (cf. Documentation/admin-guide/LSM/landlock.rst and
> Documentation/trace/events-landlock.rst). So pass the id to log to
> check_ns_type() and keep passing zero from hook_namespace_init().
> 
> No functional changes.
> 
> Fixes: f675d2e95569 ("lsm: add LSM blob and hooks for namespaces")
> Cc: <stable at kernel.org> # mainline only
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261026-work-security-namespace_free-v1-0-ffa3ebbf71bd@kernel.org?part=4




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