syzbot


kernel BUG at net/l2tp/l2tp_core.c:LINE!

Status: closed as invalid on 2019/03/06 00:11
First crash: 2240d, last: 2083d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream kernel BUG at net/l2tp/l2tp_core.c:LINE! net C 10 1388d 1383d 15/26 fixed on 2020/07/20 08:03

Sample crash report:
==================================================================
------------[ cut here ]------------
kernel BUG at net/l2tp/l2tp_core.c:1405!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
Dumping ftrace buffer:
   (ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 3753 Comm: syzkaller699220 Not tainted 4.9.83-g72766d7 #50
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
task: ffff8801b9d99800 task.stack: ffff8801c1df0000
RIP: 0010:[<ffffffff8358043d>]  [<ffffffff8358043d>] l2tp_tunnel_free+0xcd/0x110 net/l2tp/l2tp_core.c:1405
RSP: 0018:ffff8801c1df7b18  EFLAGS: 00010293
RAX: ffff8801b9d99800 RBX: ffff8801c85d9400 RCX: ffffffff8358043d
RDX: 0000000000000000 RSI: ffff8801c85d9580 RDI: ffff8801c85d9580
RBP: ffff8801c1df7b20 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801c85d9400
R13: ffff8801bd54f408 R14: ffff8801d6293980 R15: 1ffff100383bef75
FS:  0000000000000000(0000) GS:ffff8801db300000(0063) knlGS:00000000f76ffb40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000207e8ff8 CR3: 00000001bf9de000 CR4: 0000000000160670
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Stack:
 ffff8801bd54f400 ffff8801c1df7b50 ffffffff8358575d ffff8801bd54f400
 ffff8801d70eb300 00000000ffffffef ffff8801c85d9400 ffff8801c1df7d10
 ffffffff8358deea ffff8801c1df7ca8 00000112c4b9cbd0 ffff880100000002
Call Trace:
 [<ffffffff8358575d>] l2tp_tunnel_dec_refcount_1 net/l2tp/l2tp_core.c:141 [inline]
 [<ffffffff8358575d>] l2tp_session_free+0x18d/0x200 net/l2tp/l2tp_core.c:1763
 [<ffffffff8358deea>] l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:297 [inline]
 [<ffffffff8358deea>] pppol2tp_connect+0x108a/0x18f0 net/l2tp/l2tp_ppp.c:783
 [<ffffffff82ed96e6>] SYSC_connect+0x1b6/0x310 net/socket.c:1562
 [<ffffffff82edbf64>] SyS_connect+0x24/0x30 net/socket.c:1543
 [<ffffffff81006f95>] do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline]
 [<ffffffff81006f95>] do_fast_syscall_32+0x2f5/0x870 arch/x86/entry/common.c:387
 [<ffffffff838b6590>] entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137
Code: f6 83 f8 00 00 00 02 75 35 e8 00 b0 de fd 48 8d 7b 10 be 10 00 00 00 e8 22 22 d1 fd 5b 5d c3 e8 ea af de fd 0f 0b e8 e3 af de fd <0f> 0b e8 1c e4 fb fd e9 65 ff ff ff e8 12 e4 fb fd eb c2 e8 cb 
RIP  [<ffffffff8358043d>] l2tp_tunnel_free+0xcd/0x110 net/l2tp/l2tp_core.c:1405
 RSP <ffff8801c1df7b18>
---[ end trace 10ecbccff3e44da5 ]---
Kernel panic - not syncing: Fatal exception
BUG: KASAN: use-after-free in l2tp_session_create+0x16ba/0x1770 net/l2tp/l2tp_core.c:1910
Read of size 4 at addr ffff8801bd54f410 by task syzkaller699220/3755

CPU: 0 PID: 3755 Comm: syzkaller699220 Tainted: G      D         4.9.83-g72766d7 #50
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 ffff8801c1d2fa10 ffffffff81d95149 ffffea0006f55380 ffff8801bd54f410
 0000000000000000 ffff8801bd54f410 ffff8801c85d9400 ffff8801c1d2fa48
 ffffffff8153e213 ffff8801bd54f410 0000000000000004 0000000000000000
Call Trace:
 [<ffffffff81d95149>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d95149>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff8153e213>] print_address_description+0x73/0x280 mm/kasan/report.c:252
 [<ffffffff8153e735>] kasan_report_error mm/kasan/report.c:351 [inline]
 [<ffffffff8153e735>] kasan_report+0x275/0x360 mm/kasan/report.c:408
 [<ffffffff8153e874>] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:428
 [<ffffffff8358957a>] l2tp_session_create+0x16ba/0x1770 net/l2tp/l2tp_core.c:1910
 [<ffffffff8358df5e>] pppol2tp_connect+0x10fe/0x18f0 net/l2tp/l2tp_ppp.c:711
 [<ffffffff82ed96e6>] SYSC_connect+0x1b6/0x310 net/socket.c:1562
 [<ffffffff82edbf64>] SyS_connect+0x24/0x30 net/socket.c:1543
 [<ffffffff81006f95>] do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline]
 [<ffffffff81006f95>] do_fast_syscall_32+0x2f5/0x870 arch/x86/entry/common.c:387
 [<ffffffff838b6590>] entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137

Allocated by task 3755:
 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
 do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline]
 do_fast_syscall_32+0x2f5/0x870 arch/x86/entry/common.c:387
 entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137

Freed by task 3758:
 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]
 pppol2tp_connect+0x108a/0x18f0 net/l2tp/l2tp_ppp.c:783
 SYSC_connect+0x1b6/0x310 net/socket.c:1562
 SyS_connect+0x24/0x30 net/socket.c:1543
 do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline]
 do_fast_syscall_32+0x2f5/0x870 arch/x86/entry/common.c:387
 entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137

The buggy address belongs to the object at ffff8801bd54f400
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 16 bytes inside of
 512-byte region [ffff8801bd54f400, ffff8801bd54f600)
The buggy address belongs to the page:
page:ffffea0006f55380 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:
 ffff8801bd54f300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801bd54f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801bd54f400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff8801bd54f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801bd54f500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/02/24 00:57 https://android.googlesource.com/kernel/common android-4.9 72766d75b085 5c1e0207 .config console log report syz C ci-android-49-kasan-gce-386
2018/07/31 00:11 https://android.googlesource.com/kernel/common android-4.9 8956c50bdcd3 1a381291 .config console log report ci-android-49-kasan-gce
2018/07/16 11:06 https://android.googlesource.com/kernel/common android-4.9 9e7903954483 92a49505 .config console log report ci-android-49-kasan-gce-root
2018/03/19 00:34 https://android.googlesource.com/kernel/common android-4.9 bb52bba67e35 08dacaa0 .config console log report ci-android-49-kasan-gce
* Struck through repros no longer work on HEAD.