On 8/21/2024 1:12 AM, Christian Brauner wrote:
On Wed, 21 Aug 2024 00:26:22 +0100, Phillip Lougher wrote:
In the recent work to remove page->index, a sanity check
that ensured all the readhead pages were covered by the
Squashfs data block was removed [1].
To avoid any regression, this commit adds the sanity check
back in an equivalent way. Namely the page actor will now
return error if any pages are unused after completion.
[...]
Applied to the vfs.folio branch of the vfs/vfs.git tree.
Patches in the vfs.folio branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.folio
[5/5] Squashfs: Ensure all readahead pages have been used
https://git.kernel.org/vfs/vfs/c/5d85f9c952d8
When I was testing the linux-next branch I got
"BUG: KASAN: slab-use-after-free in squashfs_readahead+0x19f1/0x1e50"
It seems this is due to the access of `actor` just after freeing it.
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/fs/squashfs/page_actor.h#n41
-Fan