KASAN: use-after-free Read in diFree

10 views
Skip to first unread message

syzbot

unread,
Sep 29, 2020, 8:31:16 PM9/29/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cbfa1702 Linux 4.14.198
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1628360f900000
kernel config: https://syzkaller.appspot.com/x/.config?x=3990958d85b55e59
dashboard link: https://syzkaller.appspot.com/bug?extid=442ad4d28dd8b181e710
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1476d623900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1162cde3900000

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

ERROR: (device loop0): xtSearch: XT_GETPAGE: xtree page corrupt
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+0x16ca/0x2830 fs/jfs/jfs_imap.c:892
Read of size 4 at addr ffff888086fd0584 by task syz-executor993/7030

CPU: 0 PID: 7030 Comm: syz-executor993 Not tainted 4.14.198-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x283 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
diFree+0x16ca/0x2830 fs/jfs/jfs_imap.c:892
jfs_evict_inode+0xee/0x130 fs/jfs/inode.c:164
evict+0x2c8/0x700 fs/inode.c:555
iput_final fs/inode.c:1524 [inline]
iput+0x458/0x7e0 fs/inode.c:1551
diFreeSpecial fs/jfs/jfs_imap.c:569 [inline]
diFreeSpecial+0x63/0x80 fs/jfs/jfs_imap.c:561
jfs_umount+0xd6/0x310 fs/jfs/jfs_umount.c:78
jfs_fill_super+0x7a5/0xab0 fs/jfs/super.c:633
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:2549 [inline]
do_mount+0xe53/0x2a00 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3072
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x44807a
RSP: 002b:00007ffd2f16d898 EFLAGS: 00000283 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffd2f16d8f0 RCX: 000000000044807a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffd2f16d8b0
RBP: 00007ffd2f16d8b0 R08: 00007ffd2f16d8f0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000283 R12: 0000000000000019
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003

Allocated by task 7030:
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_trace+0x131/0x3d0 mm/slab.c:3618
kmalloc include/linux/slab.h:488 [inline]
diMount+0x4c/0x650 fs/jfs/jfs_imap.c:118
jfs_mount+0x2ba/0x380 fs/jfs/jfs_mount.c:190
jfs_fill_super+0x52a/0xab0 fs/jfs/super.c:589
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:2549 [inline]
do_mount+0xe53/0x2a00 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3072
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 7030:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kfree+0xc9/0x250 mm/slab.c:3815
diUnmount+0xe4/0x120 fs/jfs/jfs_imap.c:210
jfs_umount+0xce/0x310 fs/jfs/jfs_umount.c:76
jfs_fill_super+0x7a5/0xab0 fs/jfs/super.c:633
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:2549 [inline]
do_mount+0xe53/0x2a00 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3072
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

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

Memory state around the buggy address:
ffff888086fd0480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888086fd0500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888086fd0580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888086fd0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888086fd0680: 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
Reply all
Reply to author
Forward
0 new messages