Linux Security Modules development
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: "Günther Noack" <gnoack@google.com>
Cc: "Mickaël Salaün" <mic@digikod.net>,
	"Christian Brauner" <brauner@kernel.org>,
	"Eric Paris" <eparis@redhat.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	"Paul Moore" <paul@paul-moore.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	audit@vger.kernel.org, kernel-team@cloudflare.com,
	linux-security-module@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: [PATCH v2 0/4] Landlock: Fix namespace and capability denials
Date: Wed, 18 Nov 2026 17:32:48 +0100	[thread overview]
Message-ID: <20261118163254.2554413-1-mic@digikod.net> (raw)

Hi,

Landlock namespace denial records identify the namespace type and ID but
do not say whether the hook denied creation or entry.  The ID is object
context rather than an operation discriminator: after allocating IDs
before the namespace_init hook, construction carries an ID for a new
namespace that never becomes reachable, whereas entry carries the
existing target ID.

Capability denial tracepoints have the complementary problem.  They
report the capability number but omit the exact credentials and target
user namespace used by commoncap's capability check.  Either argument
can differ from current state, so reconstructing them from the tracing
task can misidentify the security relationship being checked.

Fix both denial interfaces without changing Landlock policy or UAPI.
Namespace denials gain distinct internal CREATE and ENTER request tags
and print namespace_op=create or namespace_op=enter after the common
blockers field and before the namespace type and ID.  Both operations
remain context for the same namespace.use blocker and describe semantic
hooks rather than exact syscall provenance.

Capability denial tracepoints gain the authoritative checked cred and
target user_ns as synchronous BTF-only arguments.  They are not copied
into the raw ring buffer, printed, audited, retained, or used for the
Landlock verdict.  Capability options remain omitted: CAP_OPT_NOAUDIT
suppresses the denial record, while the remaining bits do not explain a
Landlock decision.

Paul and Eric, please review the audit record addition and field
ordering.  The new namespace_op field is Landlock-local because Landlock
is currently the only LSM_AUDIT_DATA_NS emitter; it can move to the
generic formatter if another LSM later needs the same contract.

The base includes Christian's namespace-ID allocation fix.  Patch 1
distinguishes namespace creation and entry in audit and trace output.
Patch 2 supplies the checked capability objects to typed trace
consumers.  Patch 3 completes quiet ENTER coverage in the Landlock
selftests.  Patch 4 documents the namespace operation field.

Changes since v1:
https://patch.msgid.link/20261117102110.2524197-1-mic@digikod.net
- Rebase on the commoncap-check fixes, forward their exact user
  namespace context, and document why global checks target the initial
  user namespace.
- List the new standard BTF objects, correct capable-hook-only wording,
  and trim duplicate commit-message narration.

This series depends on the commoncap-check fixes:
https://patch.msgid.link/20261118145217.2551053-1-mic@digikod.net

Regards,

Mickaël Salaün (4):
  landlock: Distinguish namespace creation and entry denials
  landlock: Add capability objects to denial tracing
  selftests/landlock: Test namespace denial operations
  landlock: Document namespace denial operations

 Documentation/admin-guide/LSM/landlock.rst | 21 +++++-----
 Documentation/trace/events-landlock.rst    | 26 ++++++++-----
 include/trace/events/landlock.h            | 36 +++++++++++------
 security/landlock/audit.c                  | 10 ++++-
 security/landlock/cap.c                    | 45 +++++++++++++++-------
 security/landlock/log.c                    |  6 ++-
 security/landlock/log.h                    | 12 +++++-
 security/landlock/ns.c                     | 10 +++--
 security/landlock/trace.c                  | 12 +++++-
 tools/testing/selftests/landlock/ns_test.c | 25 +++++++++---
 tools/testing/selftests/landlock/trace.h   |  1 +
 11 files changed, 145 insertions(+), 59 deletions(-)


base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
prerequisite-patch-id: 365071039dd2be439f67707944d12edbe1422d60
prerequisite-patch-id: 021705fb5147cdc8edcac9dbe53c06b854cf976a
prerequisite-patch-id: ddc6687ae87f8f782ed8ad5b005834f242aec2fb
prerequisite-patch-id: 0bf745b08b99168d266461ef5b0b943a2b71eceb
prerequisite-patch-id: 03ec09be2416d4cc932b07dfb0e7450f15c22804
prerequisite-patch-id: 383fa2ce8a4ed44e4b5c828c99c5be5ee75048af
-- 
2.56.0


             reply	other threads:[~2026-11-18 16:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 16:32 Mickaël Salaün [this message]
2026-11-18 16:32 ` [PATCH v2 1/4] landlock: Distinguish namespace creation and entry denials Mickaël Salaün
2026-11-18 16:40   ` sashiko-bot
2026-11-18 16:32 ` [PATCH v2 2/4] landlock: Add capability objects to denial tracing Mickaël Salaün
2026-11-18 16:39   ` sashiko-bot
2026-11-18 16:32 ` [PATCH v2 3/4] selftests/landlock: Test namespace denial operations Mickaël Salaün
2026-11-18 16:37   ` sashiko-bot
2026-11-18 16:32 ` [PATCH v2 4/4] landlock: Document " Mickaël Salaün
2026-11-18 16:39   ` sashiko-bot

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=20261118163254.2554413-1-mic@digikod.net \
    --to=mic@digikod.net \
    --cc=audit@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=eparis@redhat.com \
    --cc=gnoack@google.com \
    --cc=kernel-team@cloudflare.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=paul@paul-moore.com \
    --cc=rostedt@goodmis.org \
    /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