KASAN: use-after-free Read in diFree

瀏覽次數:10 次
跳到第一則未讀訊息

syzbot

未讀,
2020年10月12日 晚上9:51:242020/10/12
收件者:syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a1b977b4 Linux 4.19.150
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11e64a10500000
kernel config: https://syzkaller.appspot.com/x/.config?x=c14008c8da1ca4d4
dashboard link: https://syzkaller.appspot.com/bug?extid=e5197b28b438c9aa19a1
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10644078500000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16eeb4d7900000

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

ERROR: (device loop0): xtSearch: XT_GETPAGE: xtree page corrupt
ERROR: (device loop0): xtSearch: XT_GETPAGE: xtree page corrupt
==================================================================
BUG: KASAN: use-after-free in diFree+0x18d9/0x24b0 fs/jfs/jfs_imap.c:886
Read of size 4 at addr ffff8880879d0604 by task syz-executor411/7318

CPU: 0 PID: 7318 Comm: syz-executor411 Not tainted 4.19.150-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x22c/0x33e lib/dump_stack.c:118
print_address_description.cold+0x56/0x25c mm/kasan/report.c:256
kasan_report_error.cold+0x66/0xb9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load4_noabort+0x88/0x90 mm/kasan/report.c:432
diFree+0x18d9/0x24b0 fs/jfs/jfs_imap.c:886
jfs_evict_inode+0x126/0x170 fs/jfs/inode.c:164
evict+0x2ed/0x780 fs/inode.c:559
iput_final fs/inode.c:1555 [inline]
iput+0x511/0x890 fs/inode.c:1581
diFreeSpecial fs/jfs/jfs_imap.c:563 [inline]
diFreeSpecial+0x63/0x80 fs/jfs/jfs_imap.c:555
jfs_umount+0xd6/0x310 fs/jfs/jfs_umount.c:78
jfs_fill_super+0x83c/0xb50 fs/jfs/super.c:633
mount_bdev+0x2fc/0x3b0 fs/super.c:1158
mount_fs+0xa3/0x318 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:2469 [inline]
do_mount+0x51c/0x2f10 fs/namespace.c:2799
ksys_mount+0xcf/0x130 fs/namespace.c:3015
__do_sys_mount fs/namespace.c:3029 [inline]
__se_sys_mount fs/namespace.c:3026 [inline]
__x64_sys_mount+0xba/0x150 fs/namespace.c:3026
do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x44807a
Code: b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 7d a3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 5a a3 fb ff c3 66 0f 1f 84 00 00 00 00 00
RSP: 002b:00007ffca64fa068 EFLAGS: 00000283 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffca64fa0c0 RCX: 000000000044807a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffca64fa080
RBP: 00007ffca64fa080 R08: 00007ffca64fa0c0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000283 R12: 0000000000000019
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003

Allocated by task 7318:
kmem_cache_alloc_trace+0x12f/0x4b0 mm/slab.c:3625
kmalloc include/linux/slab.h:515 [inline]
diMount+0x4b/0x860 fs/jfs/jfs_imap.c:118
jfs_mount+0x300/0x3d0 fs/jfs/jfs_mount.c:190
jfs_fill_super+0x55c/0xb50 fs/jfs/super.c:589
mount_bdev+0x2fc/0x3b0 fs/super.c:1158
mount_fs+0xa3/0x318 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:2469 [inline]
do_mount+0x51c/0x2f10 fs/namespace.c:2799
ksys_mount+0xcf/0x130 fs/namespace.c:3015
__do_sys_mount fs/namespace.c:3029 [inline]
__se_sys_mount fs/namespace.c:3026 [inline]
__x64_sys_mount+0xba/0x150 fs/namespace.c:3026
do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 7318:
__cache_free mm/slab.c:3503 [inline]
kfree+0xcc/0x250 mm/slab.c:3822
diUnmount+0xed/0x120 fs/jfs/jfs_imap.c:210
jfs_umount+0xce/0x310 fs/jfs/jfs_umount.c:76
jfs_fill_super+0x83c/0xb50 fs/jfs/super.c:633
mount_bdev+0x2fc/0x3b0 fs/super.c:1158
mount_fs+0xa3/0x318 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:2469 [inline]
do_mount+0x51c/0x2f10 fs/namespace.c:2799
ksys_mount+0xcf/0x130 fs/namespace.c:3015
__do_sys_mount fs/namespace.c:3029 [inline]
__se_sys_mount fs/namespace.c:3026 [inline]
__x64_sys_mount+0xba/0x150 fs/namespace.c:3026
do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880879d0600
which belongs to the cache kmalloc-32768 of size 32768
The buggy address is located 4 bytes inside of
32768-byte region [ffff8880879d0600, ffff8880879d8600)
The buggy address belongs to the page:
page:ffffea00021e7400 count:1 mapcount:0 mapping:ffff88812c3f5380 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea000207c808 ffffea00021e7808 ffff88812c3f5380
raw: 0000000000000000 ffff8880879d0600 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880879d0500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880879d0580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880879d0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880879d0680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880879d0700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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
回覆所有人
回覆作者
轉寄
0 則新訊息