]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
erofs: fix invalid algorithm for encoded extents
authorGao Xiang <hsiangkao@linux.alibaba.com>
Sun, 24 Aug 2025 15:11:57 +0000 (23:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:37:38 +0000 (16:37 +0200)
commitdb5d7abd379a8dcf030be8f52f99cadf7e397ba8
tree849d4e7b4ea26cf013821a0749423bd74fb451dd
parentc5fff1c37e181c2a9c4f3709e7aba59127e5d74e
erofs: fix invalid algorithm for encoded extents

[ Upstream commit 131897c65e2b86cf14bec7379f44aa8fbb407526 ]

The current algorithm sanity checks do not properly apply to new
encoded extents.

Unify the algorithm check with Z_EROFS_COMPRESSION(_RUNTIME)_MAX
and ensure consistency with sbi->available_compr_algs.

Reported-and-tested-by: syzbot+5a398eb460ddaa6f242f@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/68a8bd20.050a0220.37038e.005a.GAE@google.com
Fixes: 1d191b4ca51d ("erofs: implement encoded extent metadata")
Thanks-to: Edward Adam Davis <eadavis@qq.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/erofs/zmap.c