syzbot


KASAN: use-after-free Read in iput

Status: auto-closed as invalid on 2019/08/05 02:50
Reported-by: syzbot+f18a1ff0ab81d536da4a@syzkaller.appspotmail.com
First crash: 2117d, last: 2117d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in iput fuse C 2 2412d 2411d 8/28 fixed on 2018/07/08 03:16
upstream KASAN: use-after-free Read in iput (2) gfs2 6 1258d 1462d 0/28 auto-closed as invalid on 2021/10/12 21:28

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in iput_final fs/inode.c:1485 [inline]
BUG: KASAN: use-after-free in iput fs/inode.c:1543 [inline]
BUG: KASAN: use-after-free in iput+0x89d/0x900 fs/inode.c:1528
Read of size 8 at addr ffff8801cff20030 by task syz-executor1/12011

CPU: 1 PID: 12011 Comm: syz-executor1 Not tainted 4.9.154+ #24
 ffff8801c67d78d8 ffffffff81b47411 0000000000000000 ffffea00073fc800
 ffff8801cff20030 0000000000000008 ffffffff8156622d ffff8801c67d7910
 ffffffff81502615 0000000000000000 ffff8801cff20030 ffff8801cff20030
Call Trace:
 [<ffffffff81b47411>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81b47411>] dump_stack+0xc1/0x120 lib/dump_stack.c:51
 [<ffffffff81502615>] print_address_description+0x6f/0x238 mm/kasan/report.c:256
 [<ffffffff8150286a>] kasan_report_error mm/kasan/report.c:355 [inline]
 [<ffffffff8150286a>] kasan_report mm/kasan/report.c:412 [inline]
 [<ffffffff8150286a>] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:397
 [<ffffffff814f4a64>] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 [<ffffffff8156622d>] iput_final fs/inode.c:1485 [inline]
 [<ffffffff8156622d>] iput fs/inode.c:1543 [inline]
 [<ffffffff8156622d>] iput+0x89d/0x900 fs/inode.c:1528
 [<ffffffff8129abc4>] drop_futex_key_refs.isra.0+0x84/0xd0 kernel/futex.c:471
 [<ffffffff8129c22d>] unqueue_me kernel/futex.c:2145 [inline]
 [<ffffffff8129c22d>] futex_wait+0x26d/0x5d0 kernel/futex.c:2492
 [<ffffffff812a03a9>] do_futex+0x159/0x1a70 kernel/futex.c:3270
 [<ffffffff812a1f13>] SYSC_futex kernel/futex.c:3330 [inline]
 [<ffffffff812a1f13>] SyS_futex+0x253/0x360 kernel/futex.c:3298
 [<ffffffff810056bd>] do_syscall_64+0x1ad/0x570 arch/x86/entry/common.c:285
 [<ffffffff82816453>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Allocated by task 5816:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack mm/kasan/kasan.c:505 [inline]
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_kmalloc.part.0+0x62/0xf0 mm/kasan/kasan.c:609
 kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:594
 kmem_cache_alloc_trace+0x115/0x2d0 mm/slub.c:2742
 kmalloc include/linux/slab.h:490 [inline]
 kzalloc include/linux/slab.h:636 [inline]
 uevent_show+0x15e/0x350 drivers/base/core.c:397
 dev_attr_show+0x56/0xc0 drivers/base/core.c:121
 sysfs_kf_seq_show+0x219/0x3a0 fs/sysfs/file.c:63
 kernfs_seq_show+0x125/0x180 fs/kernfs/file.c:168
 seq_read+0x4cd/0x1250 fs/seq_file.c:240
 kernfs_fop_read+0xda/0x520 fs/kernfs/file.c:252
 __vfs_read+0x116/0x550 fs/read_write.c:449
 vfs_read+0x137/0x380 fs/read_write.c:472
 SYSC_read fs/read_write.c:588 [inline]
 SyS_read+0xdc/0x1c0 fs/read_write.c:581
 do_syscall_64+0x1ad/0x570 arch/x86/entry/common.c:285
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Freed by task 5816:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack mm/kasan/kasan.c:505 [inline]
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:582
 slab_free_hook mm/slub.c:1355 [inline]
 slab_free_freelist_hook mm/slub.c:1377 [inline]
 slab_free mm/slub.c:2958 [inline]
 kfree+0xfb/0x310 mm/slub.c:3878
 uevent_show+0x298/0x350 drivers/base/core.c:410
 dev_attr_show+0x56/0xc0 drivers/base/core.c:121
 sysfs_kf_seq_show+0x219/0x3a0 fs/sysfs/file.c:63
 kernfs_seq_show+0x125/0x180 fs/kernfs/file.c:168
 seq_read+0x4cd/0x1250 fs/seq_file.c:240
 kernfs_fop_read+0xda/0x520 fs/kernfs/file.c:252
 __vfs_read+0x116/0x550 fs/read_write.c:449
 vfs_read+0x137/0x380 fs/read_write.c:472
 SYSC_read fs/read_write.c:588 [inline]
 SyS_read+0xdc/0x1c0 fs/read_write.c:581
 do_syscall_64+0x1ad/0x570 arch/x86/entry/common.c:285
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

The buggy address belongs to the object at ffff8801cff20000
 which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 48 bytes inside of
 4096-byte region [ffff8801cff20000, ffff8801cff21000)
The buggy address belongs to the page:
page:ffffea00073fc800 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x4000000000004080(slab|head)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801cff1ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801cff1ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8801cff20000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff8801cff20080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801cff20100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/02/06 02:49 https://android.googlesource.com/kernel/common android-4.9 d79aa412c82b d672172c .config console log report ci-android-49-kasan-gce-root
* Struck through repros no longer work on HEAD.