-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-EN-26:32.zfs Errata Notice The FreeBSD Project Topic: OpenZFS data corruption involving pending block frees Category: contrib Module: openzfs Announced: 2026-11-17 Credits: Alexander Motin, Patrick Domack, Cyrille C., Wale Zhang Affects: FreeBSD 15.1 Corrected: 2026-11-14 04:46:09 UTC (stable/15, 15.2-STABLE) 2026-11-17 17:08:00 UTC (releng/15.1, 15.1-RELEASE-p7) For general information regarding FreeBSD Errata Notices and Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit . I. Background ZFS is an advanced and scalable file system originally developed by Sun Microsystems for its Solaris operating system. ZFS was integrated as part of FreeBSD starting with FreeBSD 7.0. When part of a file is freed, for example by truncation or hole punching, OpenZFS records the freed range and releases the underlying blocks when the transaction group is synced to disk. Until then, the on-disk block pointers still reference the old blocks, and the file system must treat blocks in a pending free range as holes. Block cloning, used by copy_file_range(2), lets several files share the same on-disk blocks by recording references in the block reference table. Direct I/O reads data directly from disk, bypassing the ARC. II. Problem Description Several code paths did not handle blocks with a pending free correctly: 1. When a block was cloned into a file and then freed before the clone had been synced, reads did not take the free into account and could return the cloned data. 2. When cloning a range of a file, the source block pointers were captured without checking for pending frees. If part of the source range had been freed but the free had not yet been synced, the clone took a new reference to a block that was about to be released, and the block was freed twice. 3. Direct I/O reads only checked the on-disk block pointer for holes and did not consult pending frees, so they could return data from blocks that had already been freed. III. Impact Problems 1 and 3 cause reads to return stale data in place of zeros for a recently freed range of a file. Problem 2 corrupts the pool's space accounting. Freed space may be allocated again while it is still referenced by the cloned file, leading to silent corruption of file data. Kernels built with debugging options panic instead. IV. Workaround Problems 1 and 2 can be avoided by disabling block cloning: # sysctl vfs.zfs.bclone_enabled=0 Direct I/O is disabled by default on FreeBSD. Systems that have not set vfs.zfs.dio_enabled to 1 are not affected by problem 3. The workaround should be removed once the system is updated to include the fix described in this notice. V. Solution Upgrade your system to a supported FreeBSD stable or release / security branch (releng) dated after the correction date, and reboot the system. Perform one of the following: 1) To update your system installed from base system packages: Systems running a 15.0-RELEASE or later version of FreeBSD on the amd64 or arm64 platforms, which were installed using base system packages, can be updated via the pkg(8) utility: # pkg upgrade -r FreeBSD-base # shutdown -r +10min "Rebooting for an erratum fix" 2) To update your system installed from binary distribution sets: Systems running a RELEASE version of FreeBSD on the amd64 or arm64 platforms which were not installed using base system packages can be updated via the freebsd-update(8) utility: # freebsd-update fetch # freebsd-update install # shutdown -r +10min "Rebooting for an erratum fix" 3) To update your system via a source code patch: The following patches have been verified to apply to the applicable FreeBSD release branches. a) Download the relevant patch from the location below, and verify the detached PGP signature using your PGP utility. # fetch https://security.FreeBSD.org/patches/EN-26:32/zfs.patch # fetch https://security.FreeBSD.org/patches/EN-26:32/zfs.patch.asc # gpg --verify zfs.patch.asc b) Apply the patch. Execute the following commands as root: # cd /usr/src # patch -E -p0 < /path/to/patch c) Recompile your kernel as described in and reboot the system. VI. Correction details This issue is corrected as of the corresponding Git commit hash in the following stable and release branches: Branch/path Hash Revision - ------------------------------------------------------------------------- stable/15/ afc7fc2abe80 stable/15-n286783 releng/15.1/ e00af4a8c6ea releng/15.1-n283659 - ------------------------------------------------------------------------- Run the following command to see which files were modified by a particular commit: # git show --stat Or visit the following URL, replacing NNNNNN with the hash: To determine the commit count in a working tree (for comparison against nNNNNNN in the table above), run: # git rev-list --count --first-parent HEAD VII. References The latest revision of this advisory is available at -----BEGIN PGP SIGNATURE----- iQJPBAEBCgA5FiEEthUnfoEIffdcgYM7bljekB8AGu8FAmr82iobFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMCwzAAoJEG5Y3pAfABrvMVUP/0mqryFJhfASZp0I9QBe 9X84G3P/f51V8Nhj/cokGAFQEI2VOsecmAlI1gSDqHhMeBRZHXR3/GtIFzDhdqnF mosnEYJBewR8VZR141x9qeNwPhibnyHkNfF22oi+8S3uVQCIcGStWrE8muWNM0Ze usxmUaqYlsgC9GZZedgJcSdlk32GQ4EG2pGqUlYiYxPchw33PylgBLPHrkQiDhcA boBd46dNm6M9yfTd/zTKcXNKzMAPJ5o5YyJBYLXub7Blz8JlU5T/RvzSnfEgaezo CAi0RrnrOKebGJM4srZJIH7HzsldvXNKWdfqygGDZx7tQSLWh3S1sBPoFJj0tQ7l ds7tPbfkpPLXii+sWQNvJIA5gxk9yCfC0pWukqAnHKtq/pCDyBbPDlgcpxr0tLZ7 pL5Qik8t3jLxlEDe2A/ZHHMGZuNWQ9e0l/EHn2KkjbCVu1NNCod0PR1Szgzfp1F9 fDfFBpV5bZIOhHSmT4vKoU2e3LVJZtBO92Xki/YsDq2eSK47FWxdTM4Ic24Qscvb oaBIllET0Tw8LwsCmqNzuJLLogtFzgfCP1wRRITtMwdaCu66lq/5JNFme1K6njWS lHFCt/67WKn5pb6uSz8qvej/Ph1RyMxv4iaAUTVBld2esPh/qRtSJMkK7MgQGpGD h8SYz20nZ8w4x0zPtQyo4uga =WNx6 -----END PGP SIGNATURE-----