KASAN: use-after-free Read in dbAllocBits

6 views
Skip to first unread message

syzbot

unread,
Oct 1, 2022, 8:57:35 AM10/1/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=114ffba8880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=53bcee46e072f8a108f9
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1623905c880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10327ee0880000

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+53bcee...@syzkaller.appspotmail.com

audit: type=1800 audit(1664628890.821:2): pid=8099 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor568" name="bus" dev="loop0" ino=7 res=0
==================================================================
BUG: KASAN: use-after-free in dbAllocBits+0x4d3/0x520 fs/jfs/jfs_dmap.c:2295
Read of size 8 at addr ffff8880952411b8 by task syz-executor568/8099

CPU: 0 PID: 8099 Comm: syz-executor568 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/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_load8_noabort+0x88/0x90 mm/kasan/report.c:433
dbAllocBits+0x4d3/0x520 fs/jfs/jfs_dmap.c:2295
dbAllocDmap+0x61/0x110 fs/jfs/jfs_dmap.c:2072
dbAllocDmapLev+0x159/0x330 fs/jfs/jfs_dmap.c:2026
dbAllocCtl+0x4a2/0x700 fs/jfs/jfs_dmap.c:1866
dbAllocAny+0x10e/0x1a0 fs/jfs/jfs_dmap.c:1580
dbAlloc+0x4e6/0xb00 fs/jfs/jfs_dmap.c:864
extBalloc fs/jfs/jfs_extent.c:531 [inline]
extAlloc+0x4cb/0xdb0 fs/jfs/jfs_extent.c:138
jfs_get_block+0x1f5/0xae0 fs/jfs/inode.c:258
get_more_blocks fs/direct-io.c:717 [inline]
do_direct_IO fs/direct-io.c:1003 [inline]
do_blockdev_direct_IO fs/direct-io.c:1333 [inline]
__blockdev_direct_IO+0x424b/0xef40 fs/direct-io.c:1419
blockdev_direct_IO include/linux/fs.h:3059 [inline]
jfs_direct_IO+0x10a/0x370 fs/jfs/inode.c:344
generic_file_direct_write+0x208/0x4a0 mm/filemap.c:3073
__generic_file_write_iter+0x2d0/0x610 mm/filemap.c:3252
generic_file_write_iter+0x3f8/0x730 mm/filemap.c:3323
call_write_iter include/linux/fs.h:1821 [inline]
do_iter_readv_writev+0x668/0x790 fs/read_write.c:681
do_iter_write+0x182/0x5d0 fs/read_write.c:960
vfs_writev+0x153/0x2e0 fs/read_write.c:1005
do_pwritev+0x1b6/0x270 fs/read_write.c:1094
__do_sys_pwritev2 fs/read_write.c:1153 [inline]
__se_sys_pwritev2 fs/read_write.c:1144 [inline]
__x64_sys_pwritev2+0xeb/0x150 fs/read_write.c:1144
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f0be5b56dd9
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:00007ffe6b2d2bb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0be5b56dd9
RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000003
RBP: 00007f0be5b16640 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000001400 R11: 0000000000000246 R12: 0000000200000004
R13: 0000000000000000 R14: 00080000000000fc R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea0002549040 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0xfff00000000000()
raw: 00fff00000000000 0000000000000000 ffffffff02540101 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888095241080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888095241100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888095241180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888095241200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888095241280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


---
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
Reply all
Reply to author
Forward
0 new messages