syzbot


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

Status: auto-closed as invalid on 2019/02/22 12:37
First crash: 2252d, last: 2086d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in skb_dequeue syz 1 976d 976d 0/2 auto-obsoleted due to no activity on 2023/04/23 02:47
upstream general protection fault in skb_dequeue (2) bluetooth C inconclusive done 9 921d 1006d 0/26 auto-closed as invalid on 2022/10/03 17:36
upstream KASAN: use-after-free Read in skb_dequeue net C 4 2128d 2128d 8/26 fixed on 2018/07/09 18:05
linux-4.19 KASAN: use-after-free Read in skb_dequeue syz done 1 1149d 1353d 1/1 fixed on 2021/03/29 19:17
android-44 KASAN: use-after-free Read in skb_dequeue 1 2059d 2059d 0/2 auto-closed as invalid on 2019/02/25 16:09
linux-4.19 KASAN: use-after-free Read in skb_dequeue (2) C done 2 946d 976d 1/1 fixed on 2021/10/15 14:38

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
BUG: KASAN: use-after-free in do_raw_spin_lock+0x183/0x1b0 kernel/locking/spinlock_debug.c:112
Read of size 4 at addr ffff8801b72331dc by task syz-executor3/14338

CPU: 0 PID: 14338 Comm: syz-executor3 Not tainted 4.9.112-g9e79039 #7
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 ffff8801be507c20 ffffffff81eb3249 ffffea0006dc8c80 ffff8801b72331dc
 0000000000000000 ffff8801b72331dc ffff8801b7233300 ffff8801be507c58
 ffffffff81567bd9 ffff8801b72331dc 0000000000000004 0000000000000000
Call Trace:
 [<ffffffff81eb3249>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81eb3249>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff81567bd9>] print_address_description+0x6c/0x234 mm/kasan/report.c:256
 [<ffffffff81567fe3>] kasan_report_error mm/kasan/report.c:355 [inline]
 [<ffffffff81567fe3>] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412
 [<ffffffff8153bc14>] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432
 [<ffffffff812434d3>] debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
 [<ffffffff812434d3>] do_raw_spin_lock+0x183/0x1b0 kernel/locking/spinlock_debug.c:112
 [<ffffffff839f9ea6>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:119 [inline]
 [<ffffffff839f9ea6>] _raw_spin_lock_irqsave+0x56/0x62 kernel/locking/spinlock.c:159
 [<ffffffff8302da42>] skb_dequeue+0x22/0x180 net/core/skbuff.c:2381
 [<ffffffff836bbbcb>] l2tp_session_queue_purge+0xab/0x100 net/l2tp/l2tp_core.c:918
 [<ffffffff836c789b>] pppol2tp_release+0x1fb/0x2e0 net/l2tp/l2tp_ppp.c:492
 [<ffffffff83013ab6>] sock_release+0x96/0x1c0 net/socket.c:599
 [<ffffffff83013bf6>] sock_close+0x16/0x20 net/socket.c:1046
 [<ffffffff815782e3>] __fput+0x263/0x700 fs/file_table.c:208
 [<ffffffff81578805>] ____fput+0x15/0x20 fs/file_table.c:244
 [<ffffffff8119839c>] task_work_run+0x10c/0x180 kernel/task_work.c:116
 [<ffffffff8100559c>] tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 [<ffffffff8100559c>] exit_to_usermode_loop+0xfc/0x120 arch/x86/entry/common.c:161
 [<ffffffff810064d4>] prepare_exit_to_usermode arch/x86/entry/common.c:191 [inline]
 [<ffffffff810064d4>] syscall_return_slowpath arch/x86/entry/common.c:260 [inline]
 [<ffffffff810064d4>] do_syscall_64+0x364/0x490 arch/x86/entry/common.c:287
 [<ffffffff839f9f53>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Allocated by task 14295:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack+0x43/0xd0 mm/kasan/kasan.c:505
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:609
 __kmalloc+0x11d/0x300 mm/slub.c:3741
 kmalloc include/linux/slab.h:495 [inline]
 kzalloc include/linux/slab.h:636 [inline]
 l2tp_session_create+0x38/0x16f0 net/l2tp/l2tp_core.c:1843
 pppol2tp_connect+0x10d7/0x18f0 net/l2tp/l2tp_ppp.c:718
 SYSC_connect+0x1b8/0x300 net/socket.c:1562
 SyS_connect+0x24/0x30 net/socket.c:1543
 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Freed by task 14295:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack+0x43/0xd0 mm/kasan/kasan.c:505
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_slab_free+0x72/0xc0 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
 l2tp_session_free+0x166/0x200 net/l2tp/l2tp_core.c:1770
 l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:297 [inline]
 l2tp_tunnel_closeall+0x284/0x350 net/l2tp/l2tp_core.c:1373
 l2tp_udp_encap_destroy+0x87/0xe0 net/l2tp/l2tp_core.c:1394
 udpv6_destroy_sock+0xb1/0xd0 net/ipv6/udp.c:1336
 sk_common_release+0x6d/0x300 net/core/sock.c:2727
 udp_lib_close+0x15/0x20 include/net/udp.h:203
 inet_release+0xff/0x1d0 net/ipv4/af_inet.c:434
 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:440
 sock_release+0x96/0x1c0 net/socket.c:599
 sock_close+0x16/0x20 net/socket.c:1046
 __fput+0x263/0x700 fs/file_table.c:208
 ____fput+0x15/0x20 fs/file_table.c:244
 task_work_run+0x10c/0x180 kernel/task_work.c:116
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0xfc/0x120 arch/x86/entry/common.c:161
 prepare_exit_to_usermode arch/x86/entry/common.c:191 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:260 [inline]
 do_syscall_64+0x364/0x490 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

The buggy address belongs to the object at ffff8801b7233180
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 92 bytes inside of
 512-byte region [ffff8801b7233180, ffff8801b7233380)
The buggy address belongs to the page:
page:ffffea0006dc8c80 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x8000000000004080(slab|head)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801b7233080: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
 ffff8801b7233100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801b7233180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                    ^
 ffff8801b7233200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801b7233280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/07/16 09:46 https://android.googlesource.com/kernel/common android-4.9 9e7903954483 92a49505 .config console log report ci-android-49-kasan-gce-root
2018/07/03 14:24 https://android.googlesource.com/kernel/common android-4.9 00a0bcbfcfb6 317fc8ea .config console log report ci-android-49-kasan-gce-root
2018/06/18 12:49 https://android.googlesource.com/kernel/common android-4.9 a4230beab30a 27c5f59f .config console log report ci-android-49-kasan-gce-root
2018/04/06 03:51 https://android.googlesource.com/kernel/common android-4.9 7cd956196346 a932eae6 .config console log report ci-android-49-kasan-gce
2018/02/24 00:02 https://android.googlesource.com/kernel/common android-4.9 72766d75b085 5c1e0207 .config console log report ci-android-49-kasan-gce
2018/08/02 05:22 https://android.googlesource.com/kernel/common android-4.9 0137ea2134c0 0a7cf4ec .config console log report ci-android-49-kasan-gce-386
2018/04/07 11:40 https://android.googlesource.com/kernel/common android-4.9 4fb542f2aa14 10a8987f .config console log report ci-android-49-kasan-gce-386
2018/02/17 13:41 https://android.googlesource.com/kernel/common android-4.9 a25ea24f7b7d c8b3f7c1 .config console log report ci-android-49-kasan-gce-386
* Struck through repros no longer work on HEAD.