KASAN: use-after-free Read in iput

16 views
Skip to first unread message

syzbot

unread,
Apr 14, 2019, 5:33:12 AM4/14/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: d79aa412 UPSTREAM: binder: filter out nodes when showing b..
git tree: android-4.9
console output: https://syzkaller.appspot.com/x/log.txt?x=16080a50c00000
kernel config: https://syzkaller.appspot.com/x/.config?x=dd9a2d3eeea35758
dashboard link: https://syzkaller.appspot.com/bug?extid=f18a1ff0ab81d536da4a
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

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

==================================================================
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
==================================================================


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Aug 4, 2019, 10:50:04 PM8/4/19
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages