Bug 2399898
Summary: | fs-verity "FILE CORRUPTED!" errors on ostree files after upgrading to kernel 6.16.8 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Max Chernoff <redhat> | ||||||||||
Component: | kernel | Assignee: | fedora-kernel-btrfs | ||||||||||
Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||
Severity: | unspecified | Docs Contact: | |||||||||||
Priority: | unspecified | ||||||||||||
Version: | 42 | CC: | acaringi, adscvr, airlied, bugzilla, hdegoede, hpa, josef, kernel-maint, linville, masami256, mchehab, ptalbert, steved, suraj.ghimire7, walters | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | x86_64 | ||||||||||||
OS: | Unspecified | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | Doc Type: | --- | |||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | Type: | Bug | |||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||
Documentation: | --- | CRM: | |||||||||||
Verified Versions: | Category: | --- | |||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
Embargoed: | |||||||||||||
Attachments: |
|
Description
Max Chernoff
2025-09-27 09:05:54 UTC
Created attachment 2107770 [details]
dmesg-6.16.7.log
Created attachment 2107771 [details]
dmesg-6.16.8.log
Max reports the only difference between the deployments is the kernel. And the only btrfs changes between 6.16.7 and 6.16.8 are:
commit 8193ddffd50d2c298469db7de103efa3c382b59f
btrfs: fix corruption reading compressed range when block size is smaller than page size
commit d50721cbc9d6c68790caa3eb92a9190e62d9da72
btrfs: use readahead_expand() on compressed extents
But also, while the lower file system on vda4 (btrfs) supports fs-verity, Max reports composefs.enabled = yes, not composefs.enabled = verity.
The first error looks like this, the immediately preceding message is unrelated and 3 minutes earlier.
> [ 221.844071] kernel: fs-verity (vda4, inode 9108895): FILE CORRUPTED! pos=40960, level=0, want_hash=sha256:76f0ce8a0517fd59ad7e063a9a2be910655f55d5707872183f013b9ea08562dd, real_hash=sha256:ad7facb2586fc6e966c004d7d1d16b024f5805ff7cb47c7a85dabd8b48892ca7
This looks like in-kernel signature verification, but is that expected? I'm wonder if the messages themselves are bogus, but then how is that possible?
No config changes or new patches: https://src.fedoraproject.org/rpms/kernel/c/5ccfa7c145d189accf6c27c25a05367235c77fbe?branch=f42 I was able to reproduce this with the debug kernel. With the debug kernel booted, I also tried setting SELinux to permissive after the system booted, but that didn't make any difference. I've attached the full-ish system logs (the exact command that I ran was `journalctl -b-3 --output=short-monotonic --no-hostname _UID=0 + _TRANSPORT=kernel | grep -Ev "staff_sudo_t|sshd-session"`). If it's any help, the full server configuration is available on GitHub: https://github.com/gucci-on-fleek/maxchernoff.ca > And the only btrfs changes between 6.16.7 and 6.16.8 are: > > commit 8193ddffd50d2c298469db7de103efa3c382b59f > btrfs: fix corruption reading compressed range when block size is smaller than page size > > commit d50721cbc9d6c68790caa3eb92a9190e62d9da72 > btrfs: use readahead_expand() on compressed extents I've set "compress=zstd:3" in /etc/fstab, so I probably have compression enabled (I'm not 100% certain since ostree might ignore the mount options set in /etc/fstab). Created attachment 2107871 [details]
system-logs-6.16.8-debug.log
Max confirms mount shows compression isn't being used for this Btrfs.
> /dev/vda4 on /sysroot type btrfs (ro,relatime,seclabel,discard=async,space_cache=v2,subvolid=5,subvol=/)
Offhand this isn't likely somehow specific to ostree/composefs - it smells like a generic page cache + fsverity regression and is likely reproducible by just enabling fsverity on any file I would guess. > This looks like in-kernel signature verification, but is that expected? I'm wonder if the messages themselves are bogus, but then how is that possible? It's not verifying a signature, it's verifying a digest (more in https://www.kernel.org/doc/html/latest/filesystems/fsverity.html ) Missed these in 6.16.8 somehow, but still don't seem related. And no verity changes in this kernel update. commit f1498abaf74f8d7b1e7001f16ed77818d8ae6a59 btrfs: fix subvolume deletion lockup caused by inodes xarray race commit 203cee72cf98b536ff7479deed29d1f7fd6d8e3b btrfs: fix squota compressed stats leak Fedora kernel config doesn't enable built-in signature verification. # CONFIG_FS_VERITY_BUILTIN_SIGNATURES is not set The error above is in fs/verity/verify.c:231 Max reports using bees (dedup) but although this seems like an obvious explanation, why would one kernel complain about deduped files but not another? And why initially allow access following boot, with the file corrupted message coming after a delay? The output of running `btrfs inspect-internal dump-tree /dev/vda4`: https://www.maxchernoff.ca/files/OQmNrq_6axXhwnrqkzu8D7Qsftf3T_Vv-fs-verity-tree.zstd Ok, since I was able to reproduce the issue by mounting the disk image on my desktop, I was able to bisect it to the following: d50721cbc9d6c68790caa3eb92a9190e62d9da72 is the first bad commit commit d50721cbc9d6c68790caa3eb92a9190e62d9da72 Author: Boris Burkov <boris> Date: Sat Sep 13 10:12:32 2025 -0400 btrfs: use readahead_expand() on compressed extents [ Upstream commit 9e9ff875e4174be939371667d2cc81244e31232f ] [...] Created attachment 2108079 [details]
0001-Revert-btrfs-use-readahead_expand-on-compressed-exte.patch
Reverting d50721cbc9d6 on v6.16.8 also fixes the problem, so that's for sure the problematic commit.
|