diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-10-25 13:45:34 -0700 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-10-28 10:53:43 -0700 |
| commit | 28d74059fddbd8ae83c7715056b303c402071f6f (patch) | |
| tree | 1d0f6e5cd8baeba2480b6da28b129b6247ff9ad6 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 8f8faec82aa902b1997ae578c46bcc84afbad811 (diff) | |
fsverity: Tell LSMs about signature only after verity is enabled
FS_IOC_ENABLE_VERITY calls security_inode_setintegrity() before verity
has finished being enabled. That's broken because enabling verity can
still fail at that point, e.g. due to insufficient xattr space.
Afterwards, arbitrary contents can be written to the file, which doesn't
actually have verity enabled. The in-core inode stays the same, so the
LSM considers it to have verity enabled with a valid signature. (Or
rather, in the case of IPE, which is the only LSM that implements
security_inode_setintegrity(), it also checks IS_VERITY(), which can be
bypassed by enabling verity with no signature after the file writes.)
Fix this by moving the call to security_inode_setintegrity() out of
fsverity_verify_signature() and into a new function that is called from
the appropriate places.
Fixes: 7c373e4f1445 ("fsverity: expose verified fsverity built-in signatures to LSMs")
Cc: stable@vger.kernel.org
Reviewed-by: Fan Wu <wufan@kernel.org>
Tested-by: Fan Wu <wufan@kernel.org>
Link: https://patch.msgid.link/20261025204534.122506-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
