syztest

Arnaud Lecomte posted 1 patch 2 months, 1 week ago
There is a newer version of this series
syztest
Posted by Arnaud Lecomte 2 months, 1 week ago
#syz test

--- a/fs/hfsplus/brec.c
+++ b/fs/hfsplus/brec.c
@@ -124,6 +124,12 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len)
 		data_rec_off += 2;
 	} while (data_rec_off < idx_rec_off);
 
+	if (end_off < data_off) {
+		hfs_dbg(BNODE_MOD, "corrupted node: end_off %u < data_off %u\n", end_off, data_off);
+		if (new_node)
+			hfs_bnode_put(new_node);
+		return -EIO;
+	}
 	/* move data away */
 	hfs_bnode_move(node, data_off + size, data_off,
 		       end_off - data_off);
-- 
2.43.0
Re: [syzbot] [hfs?] KASAN: out-of-bounds Read in hfsplus_bnode_move
Posted by syzbot 2 months, 1 week ago
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+6df204b70bf3261691c5@syzkaller.appspotmail.com
Tested-by: syzbot+6df204b70bf3261691c5@syzkaller.appspotmail.com

Tested on:

commit:         b711733e Merge tag 'timers-urgent-2025-07-27' of git:/..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=165a98a2580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=77f37fce3464f63d
dashboard link: https://syzkaller.appspot.com/bug?extid=6df204b70bf3261691c5
compiler:       Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
patch:          https://syzkaller.appspot.com/x/patch.diff?x=119298a2580000

Note: testing is done by a robot and is best-effort only.