fs/erofs: fix an integer overflow in symlink resolution
authorGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 13 Feb 2025 11:28:47 +0000 (19:28 +0800)
committerTom Rini <trini@konsulko.com>
Tue, 18 Feb 2025 18:32:07 +0000 (12:32 -0600)
commit7a45cb4ffeff034304789954bb222ddd7d02104a
tree94033c48c83cfd548c735cd484856ef0f563844f
parentcdc67e27500fbde1fc42528c38842e5c5d785a51
fs/erofs: fix an integer overflow in symlink resolution

See the original report [1], otherwise len + 1 will be overflowed.

Note that EROFS archive can record arbitary symlink sizes in principle,
so we don't assume a short number like 4096.

[1] https://lore.kernel.org/r/20250210164151.GN1233568@bill-the-cat

Fixes: 830613f8f5bb ("fs/erofs: add erofs filesystem support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/fs.c