]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
erofs: fix incorrect symlink detection in fast symlink
authorGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 18 Dec 2024 07:34:02 +0000 (15:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2025 12:28:30 +0000 (13:28 +0100)
commit27d6adbb3ec4a20df2df1de3051aea76c4c0c90c
tree095d2736c52ce7b9705b36701ecce05e456b91fd
parent7e5fc0da0b76d6578215a25a09db76122e1c89cc
erofs: fix incorrect symlink detection in fast symlink

commit 9ed50b8231e37b1ae863f5dec8153b98d9f389b4 upstream.

Fast symlink can be used if the on-disk symlink data is stored
in the same block as the on-disk inode, so we don’t need to trigger
another I/O for symlink data.  However, currently fs correction could be
reported _incorrectly_ if inode xattrs are too large.

In fact, these should be valid images although they cannot be handled as
fast symlinks.

Many thanks to Colin for reporting this!

Reported-by: Colin Walters <walters@verbum.org>
Reported-by: https://honggfuzz.dev/
Link: https://lore.kernel.org/r/bb2dd430-7de0-47da-ae5b-82ab2dd4d945@app.fastmail.com
Fixes: 431339ba9042 ("staging: erofs: add inode operations")
[ Note that it's a runtime misbehavior instead of a security issue. ]
Link: https://lore.kernel.org/r/20240909031911.1174718-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/erofs/inode.c