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

10 views
Skip to first unread message

syzbot

unread,
Sep 24, 2022, 5:35:47 PM9/24/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 4edbf74132a4 Linux 4.14.294
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=121f02ff080000
kernel config: https://syzkaller.appspot.com/x/.config?x=94d4cf9c4e23980f
dashboard link: https://syzkaller.appspot.com/bug?extid=82ae746b8586a568571a
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10e7d04c880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=131b89c4880000

Downloadable assets:
disk image: https://storage.googleapis.com/b40da19b4827/disk-4edbf741.raw.xz
vmlinux: https://storage.googleapis.com/a36e39677c18/vmlinux-4edbf741.xz

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

==================================================================
BUG: KASAN: slab-out-of-bounds in ciCompare fs/jfs/jfs_dtree.c:3705 [inline]
BUG: KASAN: slab-out-of-bounds in dtSearch+0x192d/0x1ba0 fs/jfs/jfs_dtree.c:651
Read of size 1 at addr ffff88808e2d310d by task syz-executor194/7989

CPU: 1 PID: 7989 Comm: syz-executor194 Not tainted 4.14.294-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/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
ciCompare fs/jfs/jfs_dtree.c:3705 [inline]
dtSearch+0x192d/0x1ba0 fs/jfs/jfs_dtree.c:651
jfs_lookup+0xf7/0x170 fs/jfs/namei.c:1470
lookup_open+0x5c4/0x1750 fs/namei.c:3220
do_last fs/namei.c:3334 [inline]
path_openat+0x14bb/0x2970 fs/namei.c:3571
do_filp_open+0x179/0x3c0 fs/namei.c:3605
do_sys_open+0x296/0x410 fs/open.c:1081
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f2dd34c40c9
RSP: 002b:00007ffffdafe728 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2dd34c40c9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000200001c0
RBP: 00007f2dd3483930 R08: 0000000000000000 R09: 0000000000000000
R10: 00007ffffdafe5f0 R11: 0000000000000246 R12: 00000000f8008000
R13: 0000000000000000 R14: 00083878000000f4 R15: 0000000000000000

Allocated by task 7989:
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:210
iget_locked+0x151/0x400 fs/inode.c:1127
jfs_iget+0x1e/0x480 fs/jfs/inode.c:41
jfs_lookup+0x156/0x170 fs/jfs/namei.c:1478
lookup_slow+0x20a/0x400 fs/namei.c:1696
walk_component+0x6a1/0xbc0 fs/namei.c:1825
link_path_walk+0x823/0x10a0 fs/namei.c:2154
path_openat+0x15e/0x2970 fs/namei.c:3570
do_filp_open+0x179/0x3c0 fs/namei.c:3605
do_sys_open+0x296/0x410 fs/open.c:1081
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88808e2d31c0
which belongs to the cache jfs_ip of size 1952
The buggy address is located 179 bytes to the left of
1952-byte region [ffff88808e2d31c0, ffff88808e2d3960)
The buggy address belongs to the page:
page:ffffea000238b4c0 count:1 mapcount:0 mapping:ffff88808e2d31c0 index:0xffff88808e2d3fff
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff88808e2d31c0 ffff88808e2d3fff 0000000100000001
raw: ffffea000238b4a0 ffff8880b0c1f348 ffff8880b0c1d680 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808e2d3000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88808e2d3080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88808e2d3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88808e2d3180: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
ffff88808e2d3200: 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 can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Sep 24, 2022, 5:36:47 PM9/24/22
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=1687aa88880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=d3389b9e781bbbea58a4
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11c31eef080000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11c35a88880000

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

==================================================================
BUG: KASAN: slab-out-of-bounds in ciCompare fs/jfs/jfs_dtree.c:3706 [inline]
BUG: KASAN: slab-out-of-bounds in dtSearch+0x1c7d/0x1ef0 fs/jfs/jfs_dtree.c:652
Read of size 1 at addr ffff88808db2610d by task syz-executor235/8103

CPU: 0 PID: 8103 Comm: syz-executor235 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/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
ciCompare fs/jfs/jfs_dtree.c:3706 [inline]
dtSearch+0x1c7d/0x1ef0 fs/jfs/jfs_dtree.c:652
jfs_lookup+0x12a/0x1c0 fs/jfs/namei.c:1466
lookup_open+0x698/0x1a20 fs/namei.c:3214
do_last fs/namei.c:3327 [inline]
path_openat+0x1804/0x2df0 fs/namei.c:3537
do_filp_open+0x18c/0x3f0 fs/namei.c:3567
do_sys_open+0x3b3/0x520 fs/open.c:1085
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f325b1f20c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffea7c1ff78 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f325b1f20c9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000200001c0
RBP: 00007f325b1b1930 R08: 0000000000000000 R09: 0000000000000000
R10: 00007ffea7c1fe40 R11: 0000000000000246 R12: 00000000f8008000
R13: 0000000000000000 R14: 00083878000000f4 R15: 0000000000000000

Allocated by task 8103:
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_lookup+0x19e/0x1c0 fs/jfs/namei.c:1474
__lookup_slow+0x246/0x4a0 fs/namei.c:1672
lookup_slow fs/namei.c:1689 [inline]
walk_component+0x7ac/0xda0 fs/namei.c:1811
link_path_walk.part.0+0x901/0x1230 fs/namei.c:2142
link_path_walk fs/namei.c:2073 [inline]
path_openat+0x1db/0x2df0 fs/namei.c:3536
do_filp_open+0x18c/0x3f0 fs/namei.c:3567
do_sys_open+0x3b3/0x520 fs/open.c:1085
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 ffff88808db261c0
which belongs to the cache jfs_ip of size 1944
The buggy address is located 179 bytes to the left of
1944-byte region [ffff88808db261c0, ffff88808db26958)
The buggy address belongs to the page:
page:ffffea000236c980 count:1 mapcount:0 mapping:ffff8880b0f15600 index:0xffff88808db26fff
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea000236c908 ffff8880b0f20a48 ffff8880b0f15600
raw: ffff88808db26fff ffff88808db261c0 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808db26000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88808db26080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88808db26100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88808db26180: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
ffff88808db26200: 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