[jfs?] KASAN: slab-out-of-bounds Read in jfs_readdir

9 views
Skip to first unread message

syzbot

unread,
Jan 12, 2023, 2:27:51 AM1/12/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=178ab516480000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=c43743ab42c635368e7a
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c43743...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in jfs_readdir+0x3395/0x3d10 fs/jfs/jfs_dtree.c:3200
Read of size 1 at addr ffff888046d740ad by task syz-executor.0/29529

CPU: 1 PID: 29529 Comm: syz-executor.0 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:0x7f5e4e33c0c9
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:00007f5e4c8ae168 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f5e4e45bf80 RCX: 00007f5e4e33c0c9
RDX: 00000000000000c5 RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f5e4e397ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffcae8573df R14: 00007f5e4c8ae300 R15: 0000000000022000

Allocated by task 29529:
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 ffff888046d74180
which belongs to the cache jfs_ip of size 1944
The buggy address is located 211 bytes to the left of
1944-byte region [ffff888046d74180, ffff888046d74918)
The buggy address belongs to the page:
page:ffffea00011b5d00 count:1 mapcount:0 mapping:ffff8882396b00c0 index:0xffff888046d74fff
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea000233a848 ffff8880b0f91a48 ffff8882396b00c0
raw: ffff888046d74fff ffff888046d74180 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888046d73f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888046d74000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888046d74080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888046d74100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888046d74180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jan 12, 2023, 2:34:45 AM1/12/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c4215ee4771b Linux 4.14.302
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1479ee86480000
kernel config: https://syzkaller.appspot.com/x/.config?x=4a9988fe055c9527
dashboard link: https://syzkaller.appspot.com/bug?extid=d26e428dbaf1367b4172
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c93ba055d204/disk-c4215ee4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bfbc929a33c1/vmlinux-c4215ee4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/444658051770/bzImage-c4215ee4.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d26e42...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in jfs_readdir+0x2eaa/0x36c0 fs/jfs/jfs_dtree.c:3199
Read of size 1 at addr ffff88804a5a80ad by task syz-executor.5/10533

CPU: 0 PID: 10533 Comm: syz-executor.5 Not tainted 4.14.302-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load1_noabort+0x68/0x70 mm/kasan/report.c:427
jfs_readdir+0x2eaa/0x36c0 fs/jfs/jfs_dtree.c:3199
iterate_dir+0x478/0x5e0 fs/readdir.c:54
SYSC_getdents64 fs/readdir.c:358 [inline]
SyS_getdents64+0x125/0x230 fs/readdir.c:339
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
RIP: 0033:0x7f50a4fa40c9
RSP: 002b:00007f50a3516168 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f50a50c3f80 RCX: 00007f50a4fa40c9
RDX: 00000000000000c5 RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00007f50a4fffae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffcd99ed8f R14: 00007f50a3516300 R15: 0000000000022000

Allocated by task 10533:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552
jfs_alloc_inode+0x18/0x50 fs/jfs/super.c:118
alloc_inode+0x5d/0x170 fs/inode.c:209
iget_locked+0x151/0x400 fs/inode.c:1126
jfs_iget+0x1e/0x480 fs/jfs/inode.c:41
jfs_fill_super+0x5f7/0xab0 fs/jfs/super.c:613
mount_bdev+0x2b3/0x360 fs/super.c:1134
mount_fs+0x92/0x2a0 fs/super.c:1237
vfs_kern_mount.part.0+0x5b/0x470 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2572 [inline]
do_mount+0xe65/0x2a30 fs/namespace.c:2905
SYSC_mount fs/namespace.c:3121 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3098
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88804a5a8180
which belongs to the cache jfs_ip of size 1952
The buggy address is located 211 bytes to the left of
1952-byte region [ffff88804a5a8180, ffff88804a5a8920)
The buggy address belongs to the page:
page:ffffea0001296a00 count:1 mapcount:0 mapping:ffff88804a5a8180 index:0xffff88804a5a8fff
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff88804a5a8180 ffff88804a5a8fff 0000000100000001
raw: ffffea0001295360 ffff8880b13cc048 ffff888238c32c80 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88804a5a7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88804a5a8000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88804a5a8080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88804a5a8100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88804a5a8180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Reply all
Reply to author
Forward
0 new messages