syzbot


KASAN: use-after-free Read in pppol2tp_release

Status: auto-closed as invalid on 2019/02/22 14:09
First crash: 2258d, last: 2061d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in pppol2tp_release C 6 2069d 1811d 0/3 public: reported C repro on 2019/04/14 00:00

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in pppol2tp_sock_to_session net/l2tp/l2tp_ppp.c:157 [inline]
BUG: KASAN: use-after-free in pppol2tp_release+0x2f2/0x310 net/l2tp/l2tp_ppp.c:504
Read of size 4 at addr ffff8801d20fa000 by task syz-executor3/25113

CPU: 1 PID: 25113 Comm: syz-executor3 Not tainted 4.4.112-g3fc4284 #32
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 0000000000000000 1fce5a3e1108be1f ffff8800b3167d00 ffffffff81d054ed
 ffffea0007483e80 ffff8801d20fa000 0000000000000000 ffff8801d20fa000
 ffffffff82dea4d0 ffff8800b3167d38 ffffffff814fd953 ffff8801d20fa000
Call Trace:
 [<ffffffff81d054ed>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d054ed>] dump_stack+0xc1/0x124 lib/dump_stack.c:51
 [<ffffffff814fd953>] print_address_description+0x73/0x260 mm/kasan/report.c:252
 [<ffffffff814fde65>] kasan_report_error mm/kasan/report.c:351 [inline]
 [<ffffffff814fde65>] kasan_report+0x285/0x370 mm/kasan/report.c:408
 [<ffffffff814fdfa4>] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:428
 [<ffffffff83467742>] pppol2tp_sock_to_session net/l2tp/l2tp_ppp.c:157 [inline]
 [<ffffffff83467742>] pppol2tp_release+0x2f2/0x310 net/l2tp/l2tp_ppp.c:504
 [<ffffffff82dea37d>] sock_release+0x8d/0x1e0 net/socket.c:586
 [<ffffffff82dea4e6>] sock_close+0x16/0x20 net/socket.c:1037
 [<ffffffff81522f93>] __fput+0x233/0x6d0 fs/file_table.c:208
 [<ffffffff815234b5>] ____fput+0x15/0x20 fs/file_table.c:244
 [<ffffffff8118bb54>] task_work_run+0x104/0x180 kernel/task_work.c:115
 [<ffffffff81003625>] tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 [<ffffffff81003625>] exit_to_usermode_loop+0x145/0x170 arch/x86/entry/common.c:251
 [<ffffffff81006545>] prepare_exit_to_usermode arch/x86/entry/common.c:282 [inline]
 [<ffffffff81006545>] syscall_return_slowpath+0x1b5/0x1f0 arch/x86/entry/common.c:347
 [<ffffffff8377635d>] int_ret_from_sys_call+0x25/0xa3

Allocated by task 25113:
 [<ffffffff81035df6>] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63
 [<ffffffff814fc9c3>] save_stack+0x43/0xd0 mm/kasan/kasan.c:512
 [<ffffffff814fcc8d>] set_track mm/kasan/kasan.c:524 [inline]
 [<ffffffff814fcc8d>] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:616
 [<ffffffff814f8f64>] __kmalloc+0x124/0x320 mm/slub.c:3613
 [<ffffffff834604c9>] kmalloc include/linux/slab.h:481 [inline]
 [<ffffffff834604c9>] kzalloc include/linux/slab.h:620 [inline]
 [<ffffffff834604c9>] l2tp_session_create+0x39/0x10f0 net/l2tp/l2tp_core.c:1744
 [<ffffffff83464b5c>] pppol2tp_connect+0x10fc/0x1930 net/l2tp/l2tp_ppp.c:718
 [<ffffffff82deed36>] SYSC_connect+0x1b6/0x310 net/socket.c:1557
 [<ffffffff82df15a4>] SyS_connect+0x24/0x30 net/socket.c:1538
 [<ffffffff837761d9>] entry_SYSCALL_64_fastpath+0x16/0x92

Freed by task 25117:
 [<ffffffff81035df6>] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63
 [<ffffffff814fc9c3>] save_stack+0x43/0xd0 mm/kasan/kasan.c:512
 [<ffffffff814fd2e2>] set_track mm/kasan/kasan.c:524 [inline]
 [<ffffffff814fd2e2>] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:589
 [<ffffffff814f9d6c>] slab_free_hook mm/slub.c:1383 [inline]
 [<ffffffff814f9d6c>] slab_free_freelist_hook mm/slub.c:1405 [inline]
 [<ffffffff814f9d6c>] slab_free mm/slub.c:2859 [inline]
 [<ffffffff814f9d6c>] kfree+0xfc/0x300 mm/slub.c:3749
 [<ffffffff8345ca50>] l2tp_session_free+0x170/0x200 net/l2tp/l2tp_core.c:1672
 [<ffffffff8345f301>] l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:293 [inline]
 [<ffffffff8345f301>] l2tp_tunnel_closeall+0x2d1/0x3b0 net/l2tp/l2tp_core.c:1279
 [<ffffffff8345fe6b>] l2tp_udp_encap_destroy+0x8b/0xf0 net/l2tp/l2tp_core.c:1300
 [<ffffffff8336e6b1>] udpv6_destroy_sock+0xb1/0xd0 net/ipv6/udp.c:1421
 [<ffffffff82e014cb>] sk_common_release+0x6b/0x300 net/core/sock.c:2680
 [<ffffffff8336d665>] udp_lib_close+0x15/0x20 include/net/udp.h:190
 [<ffffffff831d16da>] inet_release+0xfa/0x1d0 net/ipv4/af_inet.c:435
 [<ffffffff832f6f90>] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:424
 [<ffffffff82dea37d>] sock_release+0x8d/0x1e0 net/socket.c:586
 [<ffffffff82dea4e6>] sock_close+0x16/0x20 net/socket.c:1037
 [<ffffffff81522f93>] __fput+0x233/0x6d0 fs/file_table.c:208
 [<ffffffff815234b5>] ____fput+0x15/0x20 fs/file_table.c:244
 [<ffffffff8118bb54>] task_work_run+0x104/0x180 kernel/task_work.c:115
 [<ffffffff81003625>] tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 [<ffffffff81003625>] exit_to_usermode_loop+0x145/0x170 arch/x86/entry/common.c:251
 [<ffffffff81006545>] prepare_exit_to_usermode arch/x86/entry/common.c:282 [inline]
 [<ffffffff81006545>] syscall_return_slowpath+0x1b5/0x1f0 arch/x86/entry/common.c:347
 [<ffffffff8377635d>] int_ret_from_sys_call+0x25/0xa3

The buggy address belongs to the object at ffff8801d20fa000
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 0 bytes inside of
 512-byte region [ffff8801d20fa000, ffff8801d20fa200)
The buggy address belongs to the page:
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Initializing cgroup subsys schedtune
Linux version 4.4.112-g3fc4284 (syzkaller@ci) (gcc version 7.1.1 20170620 (GCC) ) #32 SMP PREEMPT Sat Jan 20 10:36:04 UTC 2018
Command line: BOOT_IMAGE=/vmlinuz root=/dev/sda1 console=ttyS0 earlyprintk=serial vsyscall=native rodata=n ftrace_dump_on_oops=orig_cpu oops=panic panic_on_warn=1 nmi_watchdog=panic panic=86400 workqueue.watchdog_thresh=120
KERNEL supported cpus:
  Intel GenuineIntel
  AMD AuthenticAMD
  Centaur CentaurHauls
x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
x86/fpu: Supporting XSAVE feature 0x01: 'x87 floating point registers'
x86/fpu: Supporting XSAVE feature 0x02: 'SSE registers'
x86/fpu: Supporting XSAVE feature 0x04: 'AVX registers'
x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
x86/fpu: Using 'eager' FPU context switches.
e820: BIOS-provided physical RAM map:
BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
BIOS-e820: [mem 0x0000000000100000-0x00000000bfffcfff] usable
BIOS-e820: [mem 0x00000000bfffd000-0x00000000bfffffff] reserved
BIOS-e820: [mem 0x00000000fffbc000-0x00000000ffffffff] reserved
BIOS-e820: [mem 0x0000000100000000-0x000000021fffffff] usable
bootconsole [earlyser0] enabled
NX (Execute Disable) protection: active
SMBIOS 2.4 present.
Hypervisor detected: KVM
e820: last_pfn = 0x220000 max_arch_pfn = 0x400000000
x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WC  UC- WT  
e820: last_pfn = 0xbfffd max_arch_pfn = 0x400000000
found SMP MP-table at [mem 0x000f32c0-0x000f32cf] mapped at [ffff8800000f32c0]
Scanning 1 areas for low memory corruption
Using GB pages for direct mapping
ACPI: Early table checksum verification disabled
ACPI: RSDP 0x00000000000F3090 000014 (v00 Google)
ACPI: RSDT 0x00000000BFFFDC70 000034 (v01 Google GOOGRSDT 00000001 GOOG 00000001)
ACPI: FACP 0x00000000BFFFFF00 0000F4 (v02 Google GOOGFACP 00000001 GOOG 00000001)
ACPI: DSDT 0x00000000BFFFDCB0 0017B2 (v01 Google GOOGDSDT 00000001 GOOG 00000001)
ACPI: FACS 0x00000000BFFFFEC0 000040
ACPI: FACS 0x00000000BFFFFEC0 000040
ACPI: SSDT 0x00000000BFFFF590 000930 (v01 Google GOOGSSDT 00000001 GOOG 00000001)
ACPI: APIC 0x00000000BFFFF4A0 000076 (v01 Google GOOGAPIC 00000001 GOOG 00000001)
ACPI: WAET 0x00000000BFFFF470 000028 (v01 Google GOOGWAET 00000001 GOOG 00000001)
kvm-clock: Using msrs 4b564d01 and 4b564d00
kvm-clock: cpu 0, msr 2:1fffd001, primary cpu clock
kvm-clock: using sched offset of 1990833765 cycles
clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
Zone ranges:
  DMA      [mem 0x0000000000001000-0x0000000000ffffff]
  DMA32    [mem 0x0000000001000000-0x00000000ffffffff]
  Normal   [mem 0x0000000100000000-0x000000021fffffff]
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000001000-0x000000000009efff]
  node   0: [mem 0x0000000000100000-0x00000000bfffcfff]
  node   0: [mem 0x0000000100000000-0x000000021fffffff]
Initmem setup node 0 [mem 0x0000000000001000-0x000000021fffffff]
kasan: KernelAddressSanitizer initialized
ACPI: PM-Timer IO Port: 0xb008
ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
Using ACPI (MADT) for SMP configuration information
smpboot: Allowing 2 CPUs, 0 hotplug CPUs
PM: Registered nosave memory: [mem 0x00000000-0x00000fff]
PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
PM: Registered nosave memory: [mem 0xbfffd000-0xbfffffff]
PM: Registered nosave memory: [mem 0xc0000000-0xfffbbfff]
PM: Registered nosave memory: [mem 0xfffbc000-0xffffffff]
e820: [mem 0xc0000000-0xfffbbfff] available for PCI devices
Booting paravirtualized kernel on KVM
clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:2 nr_node_ids:1
PERCPU: Embedded 42 pages/cpu @ffff8801db200000 s134024 r8192 d29816 u1048576
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 1935237
Kernel command line: BOOT_IMAGE=/vmlinuz root=/dev/sda1 console=ttyS0 earlyprintk=serial vsyscall=native rodata=n ftrace_dump_on_oops=orig_cpu oops=panic panic_on_warn=1 nmi_watchdog=panic panic=86400 workqueue.watchdog_thresh=120
PID hash table entries: 4096 (order: 3, 32768 bytes)
Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes)
Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes)
Memory: 6581452K/7863916K available (40431K kernel code, 6131K rwdata, 8808K rodata, 1848K init, 23616K bss, 1282464K reserved, 0K cma-reserved)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
Kernel/User page tables isolation: enabled
Running RCU self tests
Preemptible hierarchical RCU implementation.
	RCU lockdep checking is enabled.
	Build-time adjustment of leaf fanout to 64.
	RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=2
NR_IRQS:4352 nr_irqs:440 16
console [ttyS0] enabled
console [ttyS0] enabled
bootconsole [earlyser0] disabled
bootconsole [earlyser0] disabled
Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
... MAX_LOCKDEP_SUBCLASSES:  8
... MAX_LOCK_DEPTH:          48
... MAX_LOCKDEP_KEYS:        8191
... CLASSHASH_SIZE:          4096
... MAX_LOCKDEP_ENTRIES:     32768
... MAX_LOCKDEP_CHAINS:      65536
... CHAINHASH_SIZE:          32768
 memory used by lock dependency info: 8159 kB
 per task-struct memory footprint: 1920 bytes
tsc: Detected 2300.000 MHz processor
Calibrating delay loop (skipped) preset value.. 4600.00 BogoMIPS (lpj=23000000)
pid_max: default: 32768 minimum: 301
ACPI: Core revision 20150930
ACPI: 2 ACPI AML tables successfully acquired and loaded
Security Framework initialized
SELinux:  Initializing.
AppArmor: AppArmor disabled by boot time parameter
Mount-cache hash table entries: 16384 (order: 5, 131072 bytes)
Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes)
Initializing cgroup subsys io
Initializing cgroup subsys freezer
Initializing cgroup subsys hugetlb
Initializing cgroup subsys debug
CPU: Physical Processor ID: 0
mce: CPU supports 32 MCE banks
Last level iTLB entries: 4KB 1024, 2MB 1024, 4MB 1024
Last level dTLB entries: 4KB 1024, 2MB 1024, 4MB 1024, 1GB 4
Freeing SMP alternatives memory: 44K
..TIMER: vector=0x30 apic1=0 pin1=0 apic2=-1 pin2=-1
smpboot: CPU0: Intel(R) Xeon(R) CPU @ 2.30GHz (family: 0x6, model: 0x3f, stepping: 0x0)
Performance Events: unsupported p6 CPU model 63 no PMU driver, software events only.

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/01/22 04:48 https://android.googlesource.com/kernel/common android-4.4 3fc4284df70b fbbdcd92 .config console log report ci-android-44-kasan-gce
2018/08/07 07:33 https://android.googlesource.com/kernel/common android-4.4 139622602304 1beb8136 .config console log report ci-android-44-kasan-gce-386
2018/04/01 06:41 https://android.googlesource.com/kernel/common android-4.4 38f41ec1cb31 0174c6c8 .config console log report ci-android-44-kasan-gce-386
2018/03/24 01:59 https://android.googlesource.com/kernel/common android-4.4 d63fdf61a4dc 2e9d9054 .config console log report ci-android-44-kasan-gce-386
2018/03/17 02:23 https://android.googlesource.com/kernel/common android-4.4 d63fdf61a4dc 08dacaa0 .config console log report ci-android-44-kasan-gce-386
* Struck through repros no longer work on HEAD.