eBPF-based security platform
Documentation: spell labeled the American way throughout
Daniel Borkmann584f9b8ab805
diff --git a/Documentation/concepts/background/xattrs.rst b/Documentation/concepts/background/xattrs.rstindex 9241989a..74505d60 100644--- a/Documentation/concepts/background/xattrs.rst+++ b/Documentation/concepts/background/xattrs.rst@@ -57,7 +57,7 @@ exists. When a file system creates an inode, it calls the``inode_init_security`` hook. Each LSM may fill reserved slots with thexattrs the new inode should carry, and the file system writes them aspart of the same operation that creates the inode. A file system without-that support passes no slots, and the inode starts unlabelled.+that support passes no slots, and the inode starts unlabeled.Later changes go through ``setxattr(2)`` and ``removexattr(2)``. The``inode_setxattr`` and ``inode_removexattr`` hooks run before the change@@ -118,11 +118,11 @@ program labels every new inode created in a marked directory, with``bpf_inode_init_xattr()``.The seal's sleepable programs read the label with-``bpf_get_file_xattr()`` and ``bpf_get_dentry_xattr()``. A labelled inode+``bpf_get_file_xattr()`` and ``bpf_get_dentry_xattr()``. A labeled inodemay be opened for writing, removed, renamed, changed in its attributes orxattrs only by a task with runtime authority. Only such a task may setthe label itself; anyone else's attempt counts as ``SealLabel``, and-other xattr changes on a labelled inode as ``SealXattr``. The label marks+other xattr changes on a labeled inode as ``SealXattr``. The label markswhat is protected; it never grants authority to the task that carriesor copies it. The seal also refuses an overlay copy-up of a marked inode(``SealCopyUp``). See :doc:`/internals/seal`.diff --git a/Documentation/contribute/test-coverage.rst b/Documentation/contribute/test-coverage.rstindex c63e827d..99a2bb3a 100644--- a/Documentation/contribute/test-coverage.rst+++ b/Documentation/contribute/test-coverage.rst@@ -242,7 +242,7 @@ signed config image.* - Test- Covers* - ``t6001-seal-create``- - The creation helpers label what they create under a labelled+ - The creation helpers label what they create under a labeleddirectory* - ``t6002-seal-seccomp``- The seal builds with either seccomp layout in ``vmlinux.h``@@ -279,7 +279,7 @@ signed config image.* - ``t6110-pr-set-mm-identity``- ``PR_SET_MM`` executable changes* - ``t6111-seal-scratch``- - The seal against root on labelled files+ - The seal against root on labeled files* - ``t6112-key-permission``- The ``.bpf`` and ``.dm-verity`` keyrings cannot be changed* - ``t6113-verity-authority``@@ -305,7 +305,7 @@ signed config image.* - ``t6122-persist-undo``- A load whose archive copy fails is undone* - ``t6123-foreign-state-root``- - An unlabelled state root bound over the path+ - An unlabeled state root bound over the path* - ``t6124-overlay-copy-up``- An overlay over the state root* - ``t6125-tpm-identity``@@ -682,13 +682,13 @@ Most of these attacks are open threats in- A repository index or tree publication signed with a classicalalgorithm.- Removing an empty sealed directory, ``chattr`` on sealed files, POSIX- ACLs on them, and a hard link of a labelled inode into an unsealed+ ACLs on them, and a hard link of a labeled inode into an unsealeddirectory. ``t6118`` covers hard links into sealed directories only.- An eventlog larger than the size the readers accept.- A fake TPM transport that replays the attestation key name ``init``recorded. ``t6125`` covers a device with another name.- Making ``init`` read another boot ID, or miss this boot's init- record by other means than the unlabelled state directory ``t6115``+ record by other means than the unlabeled state directory ``t6115``covers, so that it binds the register again.- A target without kernel lockdown. The test kernel enables nolockdown.diff --git a/Documentation/internals/architecture.rst b/Documentation/internals/architecture.rstindex 3db97642..68871731 100644--- a/Documentation/internals/architecture.rst+++ b/Documentation/internals/architecture.rst@@ -114,7 +114,7 @@ that boot restore loads, the eventlog, the package and tree state, theimage cache and the config activation journal. The first ``init`` labelsthe tree with the ``security.bpf.shirudo`` extended attribute, shirudolabels every inode it creates there, and the seal refuses changes to-labelled inodes by tasks without runtime authority.+labeled inodes by tasks without runtime authority.Per-boot state lives under ``/run/shirudo``, a private tmpfs mount thatsystemd carries from the initrd into the root file system. The privatediff --git a/Documentation/internals/enforcement.rst b/Documentation/internals/enforcement.rstindex bc52de7b..864d80a1 100644--- a/Documentation/internals/enforcement.rst+++ b/Documentation/internals/enforcement.rst@@ -173,7 +173,7 @@ Kexecevery caller.Writable state- ``seal`` refuses changes to labelled inodes under+ ``seal`` refuses changes to labeled inodes under``/var/lib/shirudo`` to tasks without runtime authority.:doc:`seal` explains the labels.@@ -451,7 +451,7 @@ when the record it needs is missing.- ``Kexec``- Unconditional.* - ``lsm.s/file_open`` (``seal``)- - A write open of a labelled file to a task without authority. On a+ - A write open of a labeled file to a task without authority. On adirectory open, records or clears the directory mark from itslabel.- ``EACCES``@@ -459,19 +459,19 @@ when the record it needs is missing.- See the label verdict below.* - ``lsm.s/inode_unlink``, ``lsm.s/inode_setattr``,``lsm.s/inode_removexattr`` (``seal``)- - The operation on a labelled inode to a task without authority.+ - The operation on a labeled inode to a task without authority.Setattr covers truncate, chmod, chown and timestamps.- ``EACCES``- ``SealUnlink``, ``SealSetattr``, ``SealXattr``- See the label verdict below.* - ``lsm.s/inode_setxattr`` (``seal``)- Setting ``security.bpf.shirudo`` on any inode, and any other name- on a labelled inode, to a task without authority.+ on a labeled inode, to a task without authority.- ``EACCES``- ``SealLabel``, ``SealXattr``- See the label verdict below.* - ``lsm.s/inode_rename`` (``seal``)- - A labelled source, a marked destination directory or a labelled+ - A labeled source, a marked destination directory or a labeledinode it would replace, to a task without authority.- ``EACCES``- ``SealRename``, ``SealEntry``@@ -505,7 +505,7 @@ when the record it needs is missing.The label verdict of the ``seal`` hooks reads ``security.bpf.shirudo``with the caller's permission. No label (``ENODATA``), no securityextended attributes on the file system (``EOPNOTSUPP``) and a label the-caller may not read (``EACCES``, ``EPERM``) count as unlabelled, and the+caller may not read (``EACCES``, ``EPERM``) count as unlabeled, and theoperation goes ahead. A label of any length, any other read error and afailure to allocate the scratch buffer require runtime authority.:doc:`seal` explains why and what follows from it.diff --git a/Documentation/internals/seal.rst b/Documentation/internals/seal.rstindex 6b2a3342..cdabf0c2 100644--- a/Documentation/internals/seal.rst+++ b/Documentation/internals/seal.rst@@ -122,7 +122,7 @@ The first ``init`` labels the tree. When ``/var/lib/shirudo`` itself hasno label and enforcement is not yet attached, ``init`` labels everyregular file and directory on that file system under it. After that,shirudo labels each inode as it creates it, and ``init`` never labels an-entry again: an unlabelled entry, or an entry of a kind shirudo never+entry again: an unlabeled entry, or an entry of a kind shirudo nevermakes, is someone else's and is logged and ignored. With enforcementattached, ``init`` refuses a state root without a label, because that isa tree bound over the path rather than the one it sealed.@@ -134,7 +134,7 @@ and config images carry no labels; dm-verity protects them.What the seal checks---------------------For a labelled inode, these operations need runtime authority:+For a labeled inode, these operations need runtime authority:- a write open (``SealWrite``);- unlink (``SealUnlink``);@@ -144,7 +144,7 @@ For a labelled inode, these operations need runtime authority:- setting or removing any extended attribute (``SealXattr``).Setting the attribute ``security.bpf.shirudo`` itself needs runtime-authority on every inode, labelled or not (``SealLabel``), so root cannot+authority on every inode, labeled or not (``SealLabel``), so root cannotlabel an inode of its own as shirudo's.A directory with a cached mark takes new entries only from a task with@@ -165,13 +165,13 @@ The seal reads the label with the ``bpf_get_file_xattr()`` andtask may read the inode. If the seal refused every operation whose labelread failed, it would refuse every write-only open and every unlink of afile the caller cannot read, on every file system. So these results count-as unlabelled and the operation goes ahead: no label (``ENODATA``), no+as unlabeled and the operation goes ahead: no label (``ENODATA``), nosecurity extended attributes on the file system (``EOPNOTSUPP``), and alabel the caller may not read (``EACCES``, ``EPERM``). A label of anylength, any other error, and a failure to allocate the scratch bufferthe kfunc writes into require runtime authority.-Labelling at creation+Labeling at creation---------------------A file shirudo creates must carry its label from the moment it exists;@@ -196,10 +196,10 @@ state tree once more; the walk opens every directory and fills the marks.shirudo's readers do not trust an entry because it is there. They openeach path component without following symbolic links and require every-entry under a labelled directory to carry its parent's label; anything+entry under a labeled directory to carry its parent's label; anythingelse is reported as a foreign entry and refused. A path a caller namesfor shirudo to write, such as ``--report`` or ``--out``, must be an-unlabelled regular file outside any labelled directory, so a task with+unlabeled regular file outside any labeled directory, so a task withruntime authority cannot be pointed at sealed state.Limits@@ -215,9 +215,9 @@ Directory evictioncreation, links and renames into the directory are not checked, and``inode_init_security`` adds no label.-Hard links to labelled inodes+Hard links to labeled inodes``inode_link`` checks the destination directory's mark, not the- source inode. Root can hard-link a labelled file into an unsealed+ source inode. Root can hard-link a labeled file into an unsealeddirectory on the same file system. shirudo replaces state by writinga new file and renaming it over the old one, so the old inode staysreachable through that link. While a directory's mark is absent, such@@ -228,13 +228,13 @@ Label reads under another LSMThe kfuncs' read permission check runs every LSM's``inode_permission`` hook for the calling task. A policy of anotherLSM that lets a task write or unlink a file but not read it makes a- labelled inode look unlabelled to the seal, and the same failure on+ labeled inode look unlabeled to the seal, and the same failure ona directory open removes the directory's mark.Operations without a checkThe seal does not attach ``inode_rmdir``, ``inode_file_setattr`` orthe ACL hooks ``inode_set_acl`` and ``inode_remove_acl``. Root can- remove an empty labelled directory, set the immutable or append-only+ remove an empty labeled directory, set the immutable or append-onlyflag on sealed files with ``chattr``, and change their POSIX ACLs.Bind mounts@@ -245,7 +245,7 @@ Bind mountsExisting descriptorsThe seal checks operations when they start. A descriptor opened forwriting, or a writable mapping, that exists before a file is- labelled keeps working; the seal revokes nothing.+ labeled keeps working; the seal revokes nothing.Below the file systemThe hooks see VFS operations. Writes to the block device under thediff --git a/Documentation/reference/files.rst b/Documentation/reference/files.rstindex e1f61198..71faae28 100644--- a/Documentation/reference/files.rst+++ b/Documentation/reference/files.rst@@ -385,7 +385,7 @@ Extended attributes- 64 lowercase hex characters, the SHA-256 of the attribute name,the same on every build. The seal treats any value as the label.Only a task with runtime authority may set it (``SealLabel``).- A file created in a labelled directory receives the label at+ A file created in a labeled directory receives the label atcreation.* - ``security.bpf.shirudo.payload``- Each ``upatches/<bpffs-name>/`` directory in the private bpffs.diff --git a/Documentation/security/threat-model.rst b/Documentation/security/threat-model.rstindex 315fb09d..35422eed 100644--- a/Documentation/security/threat-model.rst+++ b/Documentation/security/threat-model.rst@@ -1413,7 +1413,7 @@ R21 upatches can be neutralized without detaching them(A4), by disabling kprobes through debugfs. These are readings of thekernel source and are not tested.-R22 Labelled inodes are interchangeable+R22 Labeled inodes are interchangeableThe label carries no identity. Any labeled inode passes shirudo'schecks at any sealed path, and ``lsm/sb_mount`` does not guard thefile system that holds ``/var/lib/shirudo``. In a mount namespace of