From: Cai Xinchen <caixinchen1@huawei.com>
To: <nicolas.bouchinet@oss.cyber.gouv.fr>, <xiujianfeng@huawei.com>,
<paul@paul-moore.com>, <jmorris@namei.org>, <serge@hallyn.com>,
<shuah@kernel.org>, <kalevi@kolttonen.fi>,
<caixinchen1@huawei.com>
Cc: <linux-security-module@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<bpf@vger.kernel.org>, <lujialin4@huawei.com>
Subject: [PATCH v3 7/8] Documentation/ABI: document the lockdown securityfs file
Date: Thu, 26 Nov 2026 21:13:14 +0800 [thread overview]
Message-ID: <20261126131315.1256553-8-caixinchen1@huawei.com> (raw)
In-Reply-To: <20261126131315.1256553-1-caixinchen1@huawei.com>
The /sys/kernel/security/lockdown file has existed since v5.4 but was
never documented. The rest of this series fixes the interface and adds
a selftest for it, so document it now: the levels it reports, how the
active level is marked, when the file is present, and the write
semantics (escalation only, EPERM for the current or a lower level,
EINVAL for an unknown level).
Also add the new ABI file to the LOCKDOWN SECURITY MODULE entry in
MAINTAINERS.
Reviewed-by: Nicolas Bouchinet <nicolas.bouchinet@oss.cyber.gouv.fr>
Signed-off-by: Cai Xinchen <caixinchen1@huawei.com>
---
Documentation/ABI/testing/securityfs-lockdown | 47 +++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 48 insertions(+)
create mode 100644 Documentation/ABI/testing/securityfs-lockdown
diff --git a/Documentation/ABI/testing/securityfs-lockdown b/Documentation/ABI/testing/securityfs-lockdown
new file mode 100644
index 000000000000..74eb850519e3
--- /dev/null
+++ b/Documentation/ABI/testing/securityfs-lockdown
@@ -0,0 +1,47 @@
+What: /sys/kernel/security/lockdown
+Date: August 2019
+KernelVersion: 5.4
+Contact: linux-security-module@vger.kernel.org
+Description:
+ The lockdown securityfs file reports and controls the
+ lockdown state of the running kernel. It is provided by
+ the lockdown LSM and is located at
+ /sys/kernel/security/lockdown.
+
+ The file is present only when CONFIG_SECURITY_LOCKDOWN_LSM is
+ enabled and the lockdown LSM is active, either because
+ CONFIG_SECURITY_LOCKDOWN_LSM_EARLY is set, or because it is
+ ordered in through CONFIG_LSM, the "lsm=" kernel parameter
+ or the legacy "security=" kernel parameter. Otherwise the
+ node is absent, and userspace must handle its absence.
+
+ Reading the file returns the supported lockdown levels,
+ with the currently active level enclosed in square
+ brackets. For example, when the kernel is not locked
+ down::
+
+ [none] integrity confidentiality
+
+ and when the kernel is in integrity mode::
+
+ none [integrity] confidentiality
+
+ The file is created with mode 0644: anyone may read it,
+ but writing it requires privileges, and an unprivileged
+ writer fails at open() time with EACCES.
+
+ The file may be written with the name of a level to lock
+ the kernel down further. Lockdown can only be escalated,
+ never relaxed, so writing the currently active level or a
+ lower level fails with EPERM. Writing an unrecognized
+ level fails with EINVAL. Successful writes return the
+ number of bytes written.
+
+ The kernel can also be locked down at boot time with the
+ "lockdown=" kernel parameter, or at build time via
+ CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY or
+ CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY when the
+ lockdown LSM is active.
+
+Users: fwupd and other userspace tools that query or manage
+ kernel lockdown state
diff --git a/MAINTAINERS b/MAINTAINERS
index 64f8b6153b87..c30b7d10c7c2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15753,6 +15753,7 @@ M: Xiu Jianfeng <xiujianfeng@huawei.com>
L: linux-security-module@vger.kernel.org
S: Maintained
T: git https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git
+F: Documentation/ABI/testing/securityfs-lockdown
F: security/lockdown/
LOCKING PRIMITIVES
--
2.18.0.huawei.25
next prev parent reply other threads:[~2026-11-26 12:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 13:13 [PATCH v3 0/8] lockdown: fix the securityfs interface and add tests Cai Xinchen
2026-11-26 12:55 ` sashiko-bot
2026-11-26 13:13 ` [PATCH v3 1/8] lockdown: Add break in lockdown_write Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 2/8] lockdown: remove useless decrement operation Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 3/8] lockdown: select SECURITYFS Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 4/8] lsm: remove unused lockdown audit data Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 5/8] lockdown: drop an unused include and move lockdown_reasons Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 6/8] lockdown: bound the status string with scnprintf Cai Xinchen
2026-11-26 12:52 ` sashiko-bot
2026-11-26 13:13 ` Cai Xinchen [this message]
2026-11-26 13:13 ` [PATCH v3 8/8] selftests/lsm: add lockdown securityfs test Cai Xinchen
2026-11-26 12:55 ` 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=20261126131315.1256553-8-caixinchen1@huawei.com \
--to=caixinchen1@huawei.com \
--cc=bpf@vger.kernel.org \
--cc=jmorris@namei.org \
--cc=kalevi@kolttonen.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=lujialin4@huawei.com \
--cc=nicolas.bouchinet@oss.cyber.gouv.fr \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
--cc=shuah@kernel.org \
--cc=xiujianfeng@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox