summaryrefslogtreecommitdiff
path: root/tools/unittests/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorWang Jianjian <wangjianjian3@huawei.com>2026-08-10 23:20:52 +0900
committerViacheslav Dubeyko <slava@dubeyko.com>2026-08-10 16:02:25 -0700
commitd7d54599a132408ee8ce857393974dddfb88357c (patch)
tree228207d76fd3d9279007acf63fd49bd632808f09 /tools/unittests/git@git.tavy.me:linux.git
parent6b38b82be46b242a64db8b3efc33cd15565efd08 (diff)
nilfs2: enhance btree node keys check
syzbot reported a warning on nilfs_btree_assign: WARNING: fs/nilfs2/btree.c:2302 at nilfs_btree_assign+0x983/0xbe0 fs/nilfs2/btree.c:2302, Analysis found that a corrupted file has the following btree layout: Level2(key/ptr): [ 256/15 ] Level1(key/ptr): [ 0/8, 1/9, 0/10, 3/11, 4/12, 5/13, 6/14, 139637976727559/16, 0/17 ] The test truncated the file to 2 bytes, which partially zeroes the first block and adds the file to the dirty list. When the segment constructor writes it and assigns a new blocknr for the index block, it searches the btree with key=0 and min level=2, and apparently returns -ENOENT. Therefore, we should perform more checks on the btree nodes and return early. [ryusuke: split long lines in btree.c to satisfy checkpatch and improved the error message format for clarity] Reported-by: syzbot+158be45e4d99232e1900@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=158be45e4d99232e1900 Signed-off-by: Wang Jianjian <wangjianjian3@huawei.com> Fixes: 17c76b0104e4 ("nilfs2: B-tree based block mapping") Cc: stable+noautosel@kernel.org # Warning suppression primarily Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Diffstat (limited to 'tools/unittests/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions