syzbot


KASAN: double-free or invalid-free in (null)
Status: fixed on 2020/10/01 20:36
Reported-by: syzbot+f4eac1d053d27a8a29c3@syzkaller.appspotmail.com
Fix commit: c5c6e00f6cc5 fix regression in "epoll: Keep a reference on files added to the check list"
First crash: 634d, last: 634d

Fix bisection: fixed by (bisect log) :
commit c5c6e00f6cc5d3ed0d6464b14e33f2f5c8505888
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Wed Sep 2 15:30:48 2020 +0000

  fix regression in "epoll: Keep a reference on files added to the check list"


Sample crash report:
batman_adv: batadv0: Interface activated: batadv_slave_1
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
Bluetooth: hci0 command 0x0409 tx timeout
==================================================================
BUG: KASAN: double-free or invalid-free in           (null)

CPU: 0 PID: 6845 Comm: syz-executor.0 Not tainted 4.14.195-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_double_free+0x51/0x80 mm/kasan/report.c:333
 kasan_slab_free+0x16f/0x1a0 mm/kasan/kasan.c:514
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 vcs_poll_data_free drivers/tty/vt/vc_screen.c:91 [inline]
 vcs_release+0x49/0x60 drivers/tty/vt/vc_screen.c:611
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45d5b9
RSP: 002b:00007f2ac0861c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000e9
RAX: 0000000000000000 RBX: 0000000000002ac0 RCX: 000000000045d5b9
RDX: 0000000000000005 RSI: 0000000000000001 RDI: 0000000000000006
RBP: 000000000118cf88 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020000040 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007fff7c5aad2f R14: 00007f2ac08629c0 R15: 000000000118cf4c

Allocated by task 6846:
 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]
 kzalloc include/linux/slab.h:661 [inline]
 vcs_poll_data_get.part.0+0x43/0x220 drivers/tty/vt/vc_screen.c:102
 vcs_poll_data_get drivers/tty/vt/vc_screen.c:574 [inline]
 vcs_poll+0xed/0x120 drivers/tty/vt/vc_screen.c:565
 ep_item_poll fs/eventpoll.c:887 [inline]
 ep_insert fs/eventpoll.c:1475 [inline]
 SYSC_epoll_ctl fs/eventpoll.c:2129 [inline]
 SyS_epoll_ctl+0xa91/0x2950 fs/eventpoll.c:2015
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 6844:
 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
 vcs_poll_data_free drivers/tty/vt/vc_screen.c:91 [inline]
 vcs_release+0x49/0x60 drivers/tty/vt/vc_screen.c:611
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff888094a23240
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 0 bytes inside of
 128-byte region [ffff888094a23240, ffff888094a232c0)
The buggy address belongs to the page:
page:ffffea00025288c0 count:1 mapcount:0 mapping:ffff888094a23000 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff888094a23000 0000000000000000 0000000100000015
raw: ffffea00024a5960 ffffea0002843f60 ffff88812fe52640 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888094a23100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff888094a23180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888094a23200: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                           ^
 ffff888094a23280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff888094a23300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2020/09/01 08:47 linux-4.14.y d7e78d08fa77 d5a3ae1f .config log report syz