From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=113.46.200.227 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796025490; b=Pj2CHF3goOCklLXxQCjVvTbk/xqg17WUnkZDoQQJSf2j2GTpYERofblzJFC6AXcyj7DB 7s0PJuM8P7i+qaNM/qdDGD6q80nUnDZybHVYAmSdPe32EkUxP+Qfzy5tOayR7g7FBcTcR IapfYYPXISIMMgM/ZWlGZbqy2qCQhbn0OCRDxQ/p5vym9Gt2gVdYVYMkQz7bHnlkxlcCX pCyuFJS9pKiqRONZ6o4fD3CfeKknA+sLFqNUmOAAKIC0ZjLyXjPHA47pZ7oJdUdIAHYKd Pt8Yal4fgESmre59uqIB2FdxFzew3zMiSPSs67l9Jc0UnTk+U0oyLh+HFVE4GbRQ9CQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796025490; h=DMARC-Filter:dkim-signature:Received:Received:Received:From:To:CC: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Type:X-Originating-IP:X-ClientProxiedBy; bh=CH2rixQcd6sltTV/mK9YDZIyk8mo+Zw/Z9apX18+BQc=; b=4SokxjW5elKh6YqjrPFRuCppRTUoGUq+aZRDfgSicV1/wlaA7J7fH/ExBkiv89RPO7Op aS6xtYrQ4cYBX0fWN9doV4IXV2IgsfYgwRoHMi9xcjnzoChOBUlRmWTXJUDDvSta3aLA9 7cEcVUY1XMb6jLnWgcXTRozOM2sIl+6U521ztSwlE/VrxsMP2ahMfFACbKWo7sS9MLle6 AX+MsfJQejWh+h8CRGR9yOy6XS+Nv9iXNYonMIRYRL2BvxfYqTyZfu0pfw3+/vVpGYx2+ lcE1ibSXp78Bk5+89uFxxg/iXhD3J8ClXN3CktUaOJCBBvaOpCESXRfMFam8pEBeRvA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=v41vG6li; arc=none smtp.remote-ip=113.46.200.227 Received: from canpmsgout12.his.huawei.com (canpmsgout12.his.huawei.com [113.46.200.227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1115606A335; Mon, 30 Nov 2026 07:58:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E1115606A335 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=v41vG6li dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=CH2rixQcd6sltTV/mK9YDZIyk8mo+Zw/Z9apX18+BQc=; b=v41vG6liUi8U9loLCut7dw0MfwqAkf8Q9VdqSKvdZDDPPVauXG3MrMJSuS401qZUHBQyGK4CL hLitWcNCOTGiIaWD1eOOAM6LlkgrscAxMk9gcVZmz+m542sCg1HFbgogG93R+an5adhXObO9iji Tb3/pv0ISDrAI4Epclha4uY= Received: from mail.maildlp.com (unknown [172.19.163.214]) by canpmsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4jdGZm1c9kznTWf; Mon, 30 Nov 2026 15:57:20 +0800 (CST) Received: from whupemk100010.china.huawei.com (unknown [7.152.184.41]) by mail.maildlp.com (Postfix) with ESMTPS id 5D1044057C; Mon, 30 Nov 2026 15:58:06 +0800 (CST) Received: from octopus.huawei.com (10.67.174.191) by whupemk100010.china.huawei.com (7.152.184.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Mon, 30 Nov 2026 15:58:04 +0800 From: Cai Xinchen To: , , , , , , , , CC: , , , , Subject: [PATCH v4 7/8] Documentation/ABI: document the lockdown securityfs file Date: Mon, 30 Nov 2026 16:29:13 +0800 Message-ID: <20261130082914.129495-8-caixinchen1@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20261130082914.129495-1-caixinchen1@huawei.com> References: <20261130082914.129495-1-caixinchen1@huawei.com> X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To whupemk100010.china.huawei.com (7.152.184.41) 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. Signed-off-by: Cai Xinchen --- 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 f2670f0547b2..5822d0d32235 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15710,6 +15710,7 @@ M: Xiu Jianfeng 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