syzbot


KASAN: slab-out-of-bounds Read in jfs_readdir

Status: upstream: reported on 2023/01/12 07:27
Subsystems: jfs
[Documentation on labels]
Reported-by: syzbot+c43743ab42c635368e7a@syzkaller.appspotmail.com
First crash: 709d, last: 709d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in jfs_readdir jfs C error done 17 348d 709d 25/28 fixed on 2024/03/20 11:33
linux-5.15 UBSAN: array-index-out-of-bounds in jfs_readdir origin:upstream C error 29 9d05h 264d 0/3 upstream: reported C repro on 2024/04/01 00:20
linux-4.14 KASAN: slab-out-of-bounds Read in jfs_readdir jfs 1 709d 709d 0/1 upstream: reported on 2023/01/12 07:34
upstream UBSAN: array-index-out-of-bounds in jfs_readdir jfs C inconclusive 89 12d 264d 28/28 fixed on 2024/12/16 09:50
linux-6.1 UBSAN: array-index-out-of-bounds in jfs_readdir origin:upstream missing-backport C error 46 13h11m 264d 0/3 upstream: reported C repro on 2024/04/01 00:16

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in jfs_readdir+0x3395/0x3d10 fs/jfs/jfs_dtree.c:3200
Read of size 1 at addr ffff88808ad6a0ad by task syz-executor.2/14363

CPU: 0 PID: 14363 Comm: syz-executor.2 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load1_noabort+0x88/0x90 mm/kasan/report.c:430
 jfs_readdir+0x3395/0x3d10 fs/jfs/jfs_dtree.c:3200
 iterate_dir+0x1fe/0x5c0 fs/readdir.c:53
 ksys_getdents64+0x175/0x2b0 fs/readdir.c:357
 __do_sys_getdents64 fs/readdir.c:376 [inline]
 __se_sys_getdents64 fs/readdir.c:373 [inline]
 __x64_sys_getdents64+0x6f/0xb0 fs/readdir.c:373
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f2beb9080c9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2be9e7a168 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f2beba27f80 RCX: 00007f2beb9080c9
RDX: 00000000000000c5 RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f2beb963ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff6c91274f R14: 00007f2be9e7a300 R15: 0000000000022000

Allocated by task 14363:
 kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
 jfs_alloc_inode+0x18/0x50 fs/jfs/super.c:118
 alloc_inode+0x5d/0x180 fs/inode.c:211
 iget_locked+0x193/0x480 fs/inode.c:1176
 jfs_iget+0x1a/0x4d0 fs/jfs/inode.c:41
 jfs_fill_super+0x657/0xb50 fs/jfs/super.c:613
 mount_bdev+0x2fc/0x3b0 fs/super.c:1158
 mount_fs+0xa3/0x310 fs/super.c:1261
 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961
 vfs_kern_mount fs/namespace.c:951 [inline]
 do_new_mount fs/namespace.c:2492 [inline]
 do_mount+0x115c/0x2f50 fs/namespace.c:2822
 ksys_mount+0xcf/0x130 fs/namespace.c:3038
 __do_sys_mount fs/namespace.c:3052 [inline]
 __se_sys_mount fs/namespace.c:3049 [inline]
 __x64_sys_mount+0xba/0x150 fs/namespace.c:3049
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88808ad6a180
 which belongs to the cache jfs_ip of size 1944
The buggy address is located 211 bytes to the left of
 1944-byte region [ffff88808ad6a180, ffff88808ad6a918)
The buggy address belongs to the page:
page:ffffea00022b5a80 count:1 mapcount:0 mapping:ffff88823972d540 index:0xffff88808ad6afff
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea00022b7ec8 ffff8880b0f1b948 ffff88823972d540
raw: ffff88808ad6afff ffff88808ad6a180 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808ad69f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88808ad6a000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88808ad6a080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                  ^
 ffff88808ad6a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88808ad6a180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/12 07:31 linux-4.19.y 3f8a27f9e27b 96166539 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: slab-out-of-bounds Read in jfs_readdir
2023/01/12 07:27 linux-4.19.y 3f8a27f9e27b 96166539 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: slab-out-of-bounds Read in jfs_readdir
* Struck through repros no longer work on HEAD.