Skip to content
Commit d61ec906 authored by Juntong Deng's avatar Juntong Deng Committed by Li Nan
Browse files

fs/jfs: Add check for negative db_l2nbperpage

mainline inclusion
from mainline-v6.7-rc1
commit 525b861a008143048535011f3816d407940f4bfa
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9RFEZ
CVE: CVE-2023-52810

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=525b861a008143048535011f3816d407940f4bfa



--------------------------------

l2nbperpage is log2(number of blks per page), and the minimum legal
value should be 0, not negative.

In the case of l2nbperpage being negative, an error will occur
when subsequently used as shift exponent.

Syzbot reported this bug:

UBSAN: shift-out-of-bounds in fs/jfs/jfs_dmap.c:799:12
shift exponent -16777216 is negative

Reported-by: default avatar <syzbot+debee9ab7ae2b34b0307@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=debee9ab7ae2b34b0307


Signed-off-by: default avatarJuntong Deng <juntong.deng@outlook.com>
Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent d072d975
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment