eBPF-based security platform
docs: drop the dm-verity keyring options from what signs a config
Daniel Borkmann79a429939f68
diff --git a/Documentation/internals/kernel-interfaces.rst b/Documentation/internals/kernel-interfaces.rstindex c685b1e4..64adfe27 100644--- a/Documentation/internals/kernel-interfaces.rst+++ b/Documentation/internals/kernel-interfaces.rst@@ -567,7 +567,9 @@ Kconfig``CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING`` and``CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING`` widen the keys-that verify a config; see :doc:`config-images`. ``CONFIG_SECCOMP=n``+the kernel's own check of a config accepts, but the target checks the+signature against the runtime image's certificates first; see+:doc:`config-images`. ``CONFIG_SECCOMP=n``is handled: the seal then sees no seccomp state. The attach kinds ofupatches can need further options; see :doc:`/upatches/write/attach-kinds`.diff --git a/Documentation/operate/plan/hardening.rst b/Documentation/operate/plan/hardening.rstindex 8fa5145a..7889f13b 100644--- a/Documentation/operate/plan/hardening.rst+++ b/Documentation/operate/plan/hardening.rst@@ -92,15 +92,16 @@ Kernel configurationoption.- init fails: the config image cannot be mapped* - ``CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING=n`` and- ``CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING=n``- - The kernel tries the built-in trusted keys, the secondary keyring- and the platform keyring before ``.dm-verity``. Every key in them- can sign a config the target activates: the platform keyring holds- firmware keys, and the secondary keyring takes further keys at- runtime when a trusted key signed them. The built-in keys always- count, including the module signing key of the kernel build, so- keep that key in the same custody as the config key.- - no+ ``CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING=n``:+ optional+ - The kernel's own check of a config's root signature tries the+ built-in trusted keys, the secondary keyring and the platform+ keyring before ``.dm-verity``. Before it maps a config, the+ target checks the signature against the runtime image's+ ``config.verification_key`` certificates itself, so a key that+ only those keyrings hold cannot sign a config the target+ activates.+ - no; not needed for configs* - The ``tpm_command`` LSM hook carried by the shirudo kernel build- The hook lets shirudo refuse extensions of its register byother processes.diff --git a/Documentation/operate/plan/system-requirements.rst b/Documentation/operate/plan/system-requirements.rstindex 396b891e..7eebda3c 100644--- a/Documentation/operate/plan/system-requirements.rst+++ b/Documentation/operate/plan/system-requirements.rst@@ -202,13 +202,10 @@ these options and additional ones that the tests use.* - ``CONFIG_TMPFS``, ``CONFIG_TMPFS_XATTR``- ``/run/shirudo`` carries the same label.-The dm-verity root-hash check also accepts a config signed by a key in-the kernel's built-in trusted keyring, and in the secondary or platform-keyring when ``CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING`` or-``CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING`` is set.-:doc:`/operate/plan/hardening` lists what that means for who can sign a-config, and the options the trust model assumes beyond this table:-lockdown, module signatures, ``CONFIG_COMPAT`` and others.+:doc:`/operate/plan/hardening` lists the options the trust model assumes+beyond this table, lockdown, module signatures, ``CONFIG_COMPAT`` and+others, and why the dm-verity root-hash check accepting keys of the+kernel's other keyrings does not let them sign a config.Kernel command line~~~~~~~~~~~~~~~~~~~diff --git a/Documentation/security/security-model.rst b/Documentation/security/security-model.rstindex f9ad78fd..4889b44d 100644--- a/Documentation/security/security-model.rst+++ b/Documentation/security/security-model.rst@@ -99,16 +99,16 @@ The properties above hold only on a deployment that provides theUKI and no writes under mounted file systems- Secure Boot with a signed, measured UKI and an authenticated kernelcommand line-- A kernel whose dm-verity trust path consults only keys trusted to- sign shirudo configs+- Config signing keys chosen by the authenticated runtime image- A TPM 2.0 reachable only through the kernel driver- A runtime image without generic tools- An operator host that keeps the signing key safeshirudo checks only some of these. The pre-flight of ``shirudo init``checks that the BPF LSM is active and that the kernel has the-signed-loader ABI. It does not check lockdown, the kernel configuration-or the boot chain (U10).+signed-loader ABI. The target checks a config's signature against the+runtime image's keys itself. It does not check lockdown, the kernel+configuration or the boot chain (U10).What you must do----------------diff --git a/Documentation/security/threat-model.rst b/Documentation/security/threat-model.rstindex fd8a9041..98a6e203 100644--- a/Documentation/security/threat-model.rst+++ b/Documentation/security/threat-model.rst@@ -2032,12 +2032,11 @@ U9 init can rebind the register after hiding this boot's record``--expect-pcr=9`` with the predicted value.U10 Kernel prerequisites are not checked- :Affects: A4, A5, A7, A9 and A10.+ :Affects: A4, A5, A9 and A10.:Consequence: A target without module signatures, with 32-bit- compatibility, with the dm-verity keyring options on, with a- resume device in its UKI or with writes under mounted file systems- allowed initializes without an error and without the protection- those assumptions give.+ compatibility, with a resume device in its UKI or with writes+ under mounted file systems allowed initializes without an error+ and without the protection those assumptions give.:Status: Confirmed in code: the pre-flight checks none of them.:Meanwhile: Build the kernel and its command line as:doc:`/operate/plan/hardening` describes.@@ -2209,11 +2208,9 @@ the procedures.The deployer:- Builds the kernel with the signed-loader ABI and the kernel project- patch set (A3), ``CONFIG_MODULE_SIG`` (A4),- ``CONFIG_COMPAT=n`` (A5), both- dm-verity keyring options off and no foreign built-in certificate- (A7), the TPM driver without ``i2c-dev`` or ``spidev`` on its bus- (A8), and ``CONFIG_BLK_DEV_WRITE_MOUNTED=n`` (A10)+ patch set (A3), ``CONFIG_MODULE_SIG`` (A4), ``CONFIG_COMPAT=n`` (A5),+ the TPM driver without ``i2c-dev`` or ``spidev`` on its bus (A8), and+ ``CONFIG_BLK_DEV_WRITE_MOUNTED=n`` (A10)- Boots a signed, measured UKI under Secure Boot whose command linecarries ``lsm=`` with ``bpf``, ``bpf.keyring_unsealed=1`` and``dm_verity.keyring_unsealed=1``, and whose command line, kernel and