syzbot


KASAN: use-after-free Read in remove_wait_queue (2)

Status: upstream: reported C repro on 2020/04/07 06:03
Reported-by: syzbot+696b1bc8f5d2108298ec@syzkaller.appspotmail.com
First crash: 1472d, last: 777d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in remove_wait_queue (3) kernfs C inconclusive 123 458d 884d 22/26 fixed on 2023/02/24 13:50
upstream KASAN: use-after-free Read in remove_wait_queue (2) fs C 4 2231d 2241d 5/26 fixed on 2018/06/07 13:52
android-49 KASAN: use-after-free Read in remove_wait_queue C 6 2248d 2258d 2/3 fixed on 2018/03/05 12:02
linux-4.14 KASAN: use-after-free Read in remove_wait_queue 1 1697d 1697d 0/1 auto-closed as invalid on 2019/12/24 15:10
upstream KASAN: use-after-free Read in remove_wait_queue fs C 7 2247d 2257d 4/26 fixed on 2018/02/26 20:04
linux-4.19 BUG: corrupted list in remove_wait_queue C 31139 408d 1835d 0/1 upstream: reported C repro on 2019/04/10 16:06
upstream KASAN: slab-use-after-free Read in remove_wait_queue usb input 3 300d 301d 0/26 auto-obsoleted due to no activity on 2023/10/01 17:55
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/02/15 18:32 12m retest repro linux-4.14.y report log
2022/10/12 03:30 15m retest repro linux-4.14.y report log
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2020/06/17 04:18 0m bisect fix linux-4.14.y error job log (0)
2020/05/18 03:40 26m bisect fix linux-4.14.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x3098/0x4620 kernel/locking/lockdep.c:3365
Read of size 8 at addr ffff8880985a5340 by task syz-executor686/6333

CPU: 1 PID: 6333 Comm: syz-executor686 Not tainted 4.14.175-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+0x13e/0x194 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1e2 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2ae mm/kasan/report.c:393
 __lock_acquire+0x3098/0x4620 kernel/locking/lockdep.c:3365
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3994
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x8c/0xbf kernel/locking/spinlock.c:160
 remove_wait_queue+0x1d/0x180 kernel/sched/wait.c:50
 ep_remove_wait_queue fs/eventpoll.c:611 [inline]
 ep_unregister_pollwait.isra.0+0x9b/0x350 fs/eventpoll.c:629
 ep_remove+0x48/0x450 fs/eventpoll.c:792
 eventpoll_release_file+0xb9/0x130 fs/eventpoll.c:1020
 eventpoll_release include/linux/eventpoll.h:66 [inline]
 __fput+0x53e/0x790 fs/file_table.c:201
 task_work_run+0x113/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1d6/0x220 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+0x42/0xb7
RIP: 0033:0x4401d9
RSP: 002b:00007ffdcf3becd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000021
RAX: 0000000000000003 RBX: 00000000004002c8 RCX: 00000000004401d9
RDX: 00000000004401d9 RSI: 0000000000000003 RDI: 0000000000000004
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000401a60
R13: 0000000000401af0 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 6333:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:529
 __do_kmalloc_node mm/slab.c:3682 [inline]
 __kmalloc_node+0x4c/0x70 mm/slab.c:3689
 kmalloc_node include/linux/slab.h:530 [inline]
 kvmalloc_node+0x46/0xd0 mm/util.c:397
 kvmalloc include/linux/mm.h:531 [inline]
 kvzalloc include/linux/mm.h:539 [inline]
 alloc_netdev_mqs+0x76/0xb70 net/core/dev.c:8097
 ppp_create_interface drivers/net/ppp/ppp_generic.c:3019 [inline]
 ppp_unattached_ioctl drivers/net/ppp/ppp_generic.c:864 [inline]
 ppp_ioctl+0x1313/0x221a drivers/net/ppp/ppp_generic.c:600
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x75a/0xfe0 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 6333:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcb/0x260 mm/slab.c:3815
 kvfree+0x45/0x50 mm/util.c:416
 device_release+0x15f/0x1a0 drivers/base/core.c:833
 kobject_cleanup lib/kobject.c:646 [inline]
 kobject_release lib/kobject.c:675 [inline]
 kref_put include/linux/kref.h:70 [inline]
 kobject_put+0x13e/0x1f0 lib/kobject.c:692
 put_device+0x1c/0x30 drivers/base/core.c:2014
 free_netdev+0x26f/0x360 net/core/dev.c:8219
 ppp_destroy_interface drivers/net/ppp/ppp_generic.c:3101 [inline]
 ppp_destroy_interface+0x2d7/0x3b0 drivers/net/ppp/ppp_generic.c:3064
 ppp_release+0x122/0x1a0 drivers/net/ppp/ppp_generic.c:414
 ppp_ioctl+0x52d/0x221a drivers/net/ppp/ppp_generic.c:626
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x75a/0xfe0 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880985a47c0
 which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 2944 bytes inside of
 4096-byte region [ffff8880985a47c0, ffff8880985a57c0)
The buggy address belongs to the page:
page:ffffea0002616900 count:1 mapcount:0 mapping:ffff8880985a47c0 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff8880985a47c0 0000000000000000 0000000100000001
raw: ffffea00029be3a0 ffffea00026169a0 ffff88812fe56dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880985a5200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880985a5280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880985a5300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff8880985a5380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880985a5400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/04/07 06:17 linux-4.14.y 4520f06b03ae 99a96044 .config console log report syz C ci2-linux-4-14
2022/03/04 03:34 linux-4.14.y e853993d29aa 45a13a73 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in remove_wait_queue
2020/04/18 03:40 linux-4.14.y c10b57a567e4 435c6d53 .config console log report ci2-linux-4-14
2020/04/16 08:15 linux-4.14.y c10b57a567e4 c743fcb3 .config console log report ci2-linux-4-14
2020/04/09 17:27 linux-4.14.y 4520f06b03ae a8c6a3f8 .config console log report ci2-linux-4-14
2020/04/08 20:16 linux-4.14.y 4520f06b03ae db9bcd4b .config console log report ci2-linux-4-14
2020/04/07 06:02 linux-4.14.y 4520f06b03ae 99a96044 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.