syzbot


KASAN: use-after-free Read in do_raw_spin_lock

Status: closed as invalid on 2018/04/25 22:29
First crash: 2635d, last: 2495d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in do_raw_spin_lock selinux 5 2498d 2575d 0/28 closed as invalid on 2018/02/14 14:29

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+0x1ac/0x1e0 kernel/locking/spinlock_debug.c:112
Read of size 4 at addr ffff8801cbc5b95c by task syzkaller651506/3386

CPU: 1 PID: 3386 Comm: syzkaller651506 Not tainted 4.9.77-ge12a9c4 #18
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 ffff8801c7da7c50 ffffffff81d941c9 ffffea00072f1680 ffff8801cbc5b95c
 0000000000000000 ffff8801cbc5b95c ffff8801cbc5ba80 ffff8801c7da7c88
 ffffffff8153db93 ffff8801cbc5b95c 0000000000000004 0000000000000000
Call Trace:
 [<ffffffff81d941c9>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d941c9>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff8153db93>] print_address_description+0x73/0x280 mm/kasan/report.c:252
 [<ffffffff8153e0b5>] kasan_report_error mm/kasan/report.c:351 [inline]
 [<ffffffff8153e0b5>] kasan_report+0x275/0x360 mm/kasan/report.c:408
 [<ffffffff8153e1f4>] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:428
 [<ffffffff81248b8c>] debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
 [<ffffffff81248b8c>] do_raw_spin_lock+0x1ac/0x1e0 kernel/locking/spinlock_debug.c:112
 [<ffffffff838b2a76>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:119 [inline]
 [<ffffffff838b2a76>] _raw_spin_lock_irqsave+0x56/0x70 kernel/locking/spinlock.c:159
 [<ffffffff82eee4e2>] skb_dequeue+0x22/0x180 net/core/skbuff.c:2380
 [<ffffffff83580f3b>] l2tp_session_queue_purge+0xab/0x100 net/l2tp/l2tp_core.c:918
 [<ffffffff8358d33f>] pppol2tp_release+0x1ff/0x2e0 net/l2tp/l2tp_ppp.c:492
 [<ffffffff82ed489d>] sock_release+0x8d/0x1e0 net/socket.c:599
 [<ffffffff82ed4a06>] sock_close+0x16/0x20 net/socket.c:1046
 [<ffffffff8157502c>] __fput+0x28c/0x6e0 fs/file_table.c:208
 [<ffffffff81575505>] ____fput+0x15/0x20 fs/file_table.c:244
 [<ffffffff81195795>] task_work_run+0x115/0x190 kernel/task_work.c:116
 [<ffffffff81003a4c>] tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 [<ffffffff81003a4c>] exit_to_usermode_loop+0xfc/0x120 arch/x86/entry/common.c:160
 [<ffffffff81006340>] prepare_exit_to_usermode arch/x86/entry/common.c:190 [inline]
 [<ffffffff81006340>] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
 [<ffffffff838b2ceb>] entry_SYSCALL_64_fastpath+0xe6/0xe8

Allocated by task 3386:
 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+0xad/0xe0 mm/kasan/kasan.c:609
 __kmalloc+0x11d/0x310 mm/slub.c:3741
 kmalloc include/linux/slab.h:495 [inline]
 kzalloc include/linux/slab.h:636 [inline]
 l2tp_session_create+0x38/0x1770 net/l2tp/l2tp_core.c:1839
 pppol2tp_connect+0x10fe/0x18f0 net/l2tp/l2tp_ppp.c:711
 SYSC_connect+0x1b6/0x310 net/socket.c:1562
 SyS_connect+0x24/0x30 net/socket.c:1543
 entry_SYSCALL_64_fastpath+0x29/0xe8

Freed by task 3387:
 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+0x103/0x300 mm/slub.c:3878
 l2tp_session_free+0x166/0x200 net/l2tp/l2tp_core.c:1766
 l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:297 [inline]
 l2tp_tunnel_closeall+0x26c/0x3a0 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+0x6b/0x2f0 net/core/sock.c:2727
 udp_lib_close+0x15/0x20 include/net/udp.h:203
 inet_release+0xfa/0x1d0 net/ipv4/af_inet.c:434
 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:437
 sock_release+0x8d/0x1e0 net/socket.c:599
 sock_close+0x16/0x20 net/socket.c:1046
 __fput+0x28c/0x6e0 fs/file_table.c:208
 ____fput+0x15/0x20 fs/file_table.c:244
 task_work_run+0x115/0x190 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:160
 prepare_exit_to_usermode arch/x86/entry/common.c:190 [inline]
 syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
 entry_SYSCALL_64_fastpath+0xe6/0xe8

The buggy address belongs to the object at ffff8801cbc5b900
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 92 bytes inside of
 512-byte region [ffff8801cbc5b900, ffff8801cbc5bb00)
The buggy address belongs to the page:
page:ffffea00072f1680 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:
 ffff8801cbc5b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801cbc5b880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801cbc5b900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                    ^
 ffff8801cbc5b980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801cbc5ba00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/01/22 05:18 https://android.googlesource.com/kernel/common android-4.9 e12a9c4458ff fbbdcd92 .config console log report syz C ci-android-49-kasan-gce
2017/09/08 01:21 https://android.googlesource.com/kernel/common android-4.9 9983305173b5 d18bfda0 .config console log report syz C ci-android-49-kasan-gce
2018/01/20 13:49 https://android.googlesource.com/kernel/common android-4.9 e12a9c4458ff fbbdcd92 .config console log report syz C ci-android-49-kasan-gce-386
2017/09/30 03:27 https://android.googlesource.com/kernel/common android-4.9 9b2b08179641 c26ea367 .config console log report syz ci-android-49-kasan-gce
2017/09/24 16:47 https://android.googlesource.com/kernel/common android-4.9 47589a56b906 c26ea367 .config console log report syz ci-android-49-kasan-gce
2017/09/24 05:22 https://android.googlesource.com/kernel/common android-4.9 47589a56b906 c26ea367 .config console log report syz ci-android-49-kasan-gce
2017/09/15 10:42 https://android.googlesource.com/kernel/common android-4.9 f7d2974f3432 2bab8ad8 .config console log report syz ci-android-49-kasan-gce
2017/09/09 20:03 https://android.googlesource.com/kernel/common android-4.9 93babebe30d1 d18bfda0 .config console log report syz ci-android-49-kasan-gce
2017/09/07 23:14 https://android.googlesource.com/kernel/common android-4.9 9983305173b5 d18bfda0 .config console log report syz ci-android-49-kasan-gce
2017/09/03 23:03 https://android.googlesource.com/kernel/common android-4.9 9100442602d8 a54dce00 .config console log report syz ci-android-49-kasan-gce
2017/11/26 23:20 https://android.googlesource.com/kernel/common android-4.9 ea83e4a902ba deb5f6ae .config console log report ci-android-49-kasan-gce
2017/11/25 00:34 https://android.googlesource.com/kernel/common android-4.9 ea83e4a902ba deb5f6ae .config console log report ci-android-49-kasan-gce
2017/11/11 21:33 https://android.googlesource.com/kernel/common android-4.9 904c79c425ab e0a2b195 .config console log report ci-android-49-kasan-gce
2017/11/10 21:40 https://android.googlesource.com/kernel/common android-4.9 904c79c425ab e0a2b195 .config console log report ci-android-49-kasan-gce
* Struck through repros no longer work on HEAD.