diff options
author | Eric Biggers <[email protected]> | 2021-03-02 12:04:19 -0800 |
---|---|---|
committer | Theodore Ts'o <[email protected]> | 2021-03-11 10:38:50 -0500 |
commit | f053cf7aa66cd9d592b0fc967f4d887c2abff1b7 (patch) | |
tree | 0c81b0b773d4f5e5b595ced3b6953df807fa5276 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | c915fb80eaa6194fa9bd0a4487705cd5b0dda2f1 (diff) |
ext4: fix error handling in ext4_end_enable_verity()
ext4 didn't properly clean up if verity failed to be enabled on a file:
- It left verity metadata (pages past EOF) in the page cache, which
would be exposed to userspace if the file was later extended.
- It didn't truncate the verity metadata at all (either from cache or
from disk) if an error occurred while setting the verity bit.
Fix these bugs by adding a call to truncate_inode_pages() and ensuring
that we truncate the verity metadata (both from cache and from disk) in
all error paths. Also rework the code to cleanly separate the success
path from the error paths, which makes it much easier to understand.
Reported-by: Yunlei He <[email protected]>
Fixes: c93d8f885809 ("ext4: add basic fs-verity support")
Cc: [email protected] # v5.4+
Signed-off-by: Eric Biggers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions