==================================================================
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.13.0-rc6-next-20170825+ #9
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:16 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:52
register_lock_class+0x55e/0x2c70 kernel/locking/lockdep.c:769
__lock_acquire+0x203/0x4620 kernel/locking/lockdep.c:3385
lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4002
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:175
spin_lock_bh include/linux/spinlock.h:321 [inline]
tun_flow_cleanup+0xf4/0x300 drivers/net/tun.c:383
call_timer_fn+0x246/0x850 kernel/time/timer.c:1268
expire_timers kernel/time/timer.c:1307 [inline]
__run_timers+0x7fd/0xb90 kernel/time/timer.c:1601
run_timer_softirq+0x21/0x80 kernel/time/timer.c:1614
__do_softirq+0x2bb/0xbd0 kernel/softirq.c:284
invoke_softirq kernel/softirq.c:364 [inline]
irq_exit+0x1d3/0x210 kernel/softirq.c:405
exiting_irq arch/x86/include/asm/apic.h:638 [inline]
smp_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:1044
apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:577
RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:824 [inline]
RIP: 0010:tick_nohz_idle_enter+0x112/0x160 kernel/time/tick-sched.c:979
RSP: 0018:ffff88003e057eb0 EFLAGS: 00000297 ORIG_RAX: ffffffffffffff10
RAX: ffff88003e04e340 RBX: ffff88003ed1db80 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffffff85ac8c38
RBP: ffff88003e057eb8 R08: ffffffff8161c999 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88003ed13040
R13: 000000000034007c R14: 0000000000000000 R15: 0000000000000000
do_idle+0x29/0x3b0 kernel/sched/idle.c:223
cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:351
start_secondary+0x277/0x310 arch/x86/kernel/smpboot.c:275
secondary_startup_64+0xa5/0xa5 arch/x86/kernel/head_64.S:235
BUG: KASAN: use-after-free in __collect_expired_timers include/linux/list.h:729 [inline]
BUG: KASAN: use-after-free in collect_expired_timers kernel/time/timer.c:1550 [inline]
BUG: KASAN: use-after-free in __run_timers+0xa2e/0xb90 kernel/time/timer.c:1597
Write of size 8 at addr ffff8800697eb948 by task swapper/2/0
CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.13.0-rc6-next-20170825+ #9
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:16 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:52
print_address_description+0x73/0x250 mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report+0x24e/0x340 mm/kasan/report.c:409
__asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:435
__collect_expired_timers include/linux/list.h:729 [inline]
collect_expired_timers kernel/time/timer.c:1550 [inline]
__run_timers+0xa2e/0xb90 kernel/time/timer.c:1597
run_timer_softirq+0x21/0x80 kernel/time/timer.c:1614
__do_softirq+0x2bb/0xbd0 kernel/softirq.c:284
invoke_softirq kernel/softirq.c:364 [inline]
irq_exit+0x1d3/0x210 kernel/softirq.c:405
exiting_irq arch/x86/include/asm/apic.h:638 [inline]
smp_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:1044
apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:577
RIP: 0010:native_safe_halt+0x6/0x10 arch/x86/include/asm/irqflags.h:53
RSP: 0018:ffff88006dacfdb0 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff10
RAX: dffffc0000000000 RBX: 1ffff1000db59fb9 RCX: 0000000000000000
RDX: 1ffffffff0b59188 RSI: 0000000000000001 RDI: ffffffff85ac8c40
RBP: ffff88006dacfdb0 R08: ffffffff8161c999 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff85ac8c30
R13: ffff88006dacfe68 R14: 0000000000000000 R15: ffff88006dac6040
arch_safe_halt arch/x86/include/asm/paravirt.h:98 [inline]
default_idle+0xbf/0x460 arch/x86/kernel/process.c:341
arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:332
default_idle_call+0x36/0x90 kernel/sched/idle.c:98
cpuidle_idle_call kernel/sched/idle.c:156 [inline]
do_idle+0x256/0x3b0 kernel/sched/idle.c:246
cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:351
start_secondary+0x277/0x310 arch/x86/kernel/smpboot.c:275
secondary_startup_64+0xa5/0xa5 arch/x86/kernel/head_64.S:235
Allocated by task 8323:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
__do_kmalloc mm/slab.c:3725 [inline]
__kmalloc+0x162/0x760 mm/slab.c:3734
kmalloc include/linux/slab.h:498 [inline]
kzalloc include/linux/slab.h:666 [inline]
__crypto_alloc_tfm+0xd0/0x4e0 crypto/api.c:358
crypto_init_skcipher_ops_blkcipher crypto/skcipher.c:653 [inline]
crypto_skcipher_init_tfm+0x4ee/0x840 crypto/skcipher.c:819
crypto_create_tfm+0xdf/0x2e0 crypto/api.c:461
crypto_alloc_tfm+0x11c/0x2e0 crypto/api.c:539
crypto_alloc_skcipher+0x2c/0x40 crypto/skcipher.c:921
skcipher_bind+0x6c/0xe0 crypto/algif_skcipher.c:318
alg_bind+0x1ab/0x440 crypto/af_alg.c:179
SYSC_bind+0x1b4/0x3f0 net/socket.c:1476
SyS_bind+0x24/0x30 net/socket.c:1462
entry_SYSCALL_64_fastpath+0x1f/0xbe
Freed by task 8323:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3503 [inline]
kfree+0xca/0x250 mm/slab.c:3820
kzfree+0x28/0x30 mm/slab_common.c:1440
crypto_destroy_tfm+0x140/0x2e0 crypto/api.c:580
crypto_free_tfm include/linux/crypto.h:601 [inline]
crypto_free_blkcipher include/linux/crypto.h:1102 [inline]
crypto_exit_skcipher_ops_blkcipher+0x34/0x40 crypto/skcipher.c:639
crypto_exit_ops crypto/api.c:314 [inline]
crypto_destroy_tfm+0xb9/0x2e0 crypto/api.c:578
crypto_free_skcipher include/crypto/skcipher.h:212 [inline]
skcipher_release+0x30/0x50 crypto/algif_skcipher.c:333
alg_do_release crypto/af_alg.c:119 [inline]
alg_sock_destruct+0x88/0xe0 crypto/af_alg.c:360
__sk_destruct+0xfd/0x910 net/core/sock.c:1570
sk_destruct+0x47/0x80 net/core/sock.c:1605
__sk_free+0x57/0x230 net/core/sock.c:1613
sk_free+0x2a/0x40 net/core/sock.c:1624
sock_put include/net/sock.h:1649 [inline]
af_alg_release+0x5d/0x70 crypto/af_alg.c:126
sock_release+0x8d/0x1e0 net/socket.c:597
sock_close+0x16/0x20 net/socket.c:1126
__fput+0x333/0x7f0 fs/file_table.c:210
____fput+0x15/0x20 fs/file_table.c:246
task_work_run+0x199/0x270 kernel/task_work.c:112
exit_task_work include/linux/task_work.h:21 [inline]
do_exit+0xa52/0x1b40 kernel/exit.c:865
do_group_exit+0x149/0x400 kernel/exit.c:968
get_signal+0x7e8/0x17e0 kernel/signal.c:2334
do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:808
exit_to_usermode_loop+0x224/0x300 arch/x86/entry/common.c:158
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath+0x42f/0x500 arch/x86/entry/common.c:266
entry_SYSCALL_64_fastpath+0xbc/0xbe
The buggy address belongs to the object at ffff8800697e8540
which belongs to the cache kmalloc-16384 of size 16384
The buggy address is located 13320 bytes inside of
16384-byte region [ffff8800697e8540, ffff8800697ec540)
The buggy address belongs to the page:
page:ffffea0001a5fa00 count:1 mapcount:0 mapping:ffff8800697e8540 index:0x0 compound_mapcount: 0
flags: 0x500000000008100(slab|head)
raw: 0500000000008100 ffff8800697e8540 0000000000000000 0000000100000001
raw: ffffea0001a8f820 ffffea0001ac5620 ffff88003e802200 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8800697eb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8800697eb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8800697eb900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8800697eb980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8800697eba00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================