]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
fuse2fs: fix readlink failure
authorDarrick J. Wong <djwong@kernel.org>
Thu, 7 Aug 2025 17:30:34 +0000 (10:30 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 21 Aug 2025 00:00:54 +0000 (17:00 -0700)
commitbc1279f60fde251991030d3aaec7711d2c6eb4b0
treeabb7ad50e6ff9cc6b2b7b27705da80724da77514
parent53136b205486590aa035a02d7aaab63f12cfbc22
fuse2fs: fix readlink failure

For readlink of slow symlinks, an IO error when reading the link target
cause memory corruption.  This happens because the error case for
ext2fs_file_read closes the file, translates the error, but then jumps
down to the regular termination code, which re-closes the file and is
hence a UAF.  Straighten out the error paths to eliminate the UAF.
Also fix the bug that short target reads aren't flagged as corruption
as is done in the kernel.

Cc: <linux-ext4@vger.kernel.org> # v1.43
Fixes: 81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
misc/fuse2fs.c