KASAN: double-free or invalid-free in (null)

15 views
Skip to first unread message

syzbot

unread,
Sep 1, 2020, 4:47:16 AM9/1/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d7e78d08 Linux 4.14.195
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=157b1115900000
kernel config: https://syzkaller.appspot.com/x/.config?x=6608b656f49b4e8c
dashboard link: https://syzkaller.appspot.com/bug?extid=f4eac1d053d27a8a29c3
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13473225900000

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

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


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

syzbot

unread,
Oct 1, 2020, 12:26:06 PM10/1/20
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit c5c6e00f6cc5d3ed0d6464b14e33f2f5c8505888
Author: Al Viro <vi...@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"

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1666b27b900000
start commit: d7e78d08 Linux 4.14.195
git tree: linux-4.14.y
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13473225900000

If the result looks correct, please mark the issue as fixed by replying with:

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

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages