================================================================== BUG: KASAN: use-after-free in hlist_move_list include/linux/list.h:729 [inline] BUG: KASAN: use-after-free in __collect_expired_timers kernel/time/timer.c:1339 [inline] BUG: KASAN: use-after-free in collect_expired_timers kernel/time/timer.c:1569 [inline] BUG: KASAN: use-after-free in __run_timers+0xa2e/0xb90 kernel/time/timer.c:1616 Write of size 8 at addr ffff8801c2a04048 by task sshd/2976 CPU: 0 PID: 2976 Comm: sshd Not tainted 4.13.0-next-20170913+ #21 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 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 hlist_move_list include/linux/list.h:729 [inline] __collect_expired_timers kernel/time/timer.c:1339 [inline] collect_expired_timers kernel/time/timer.c:1569 [inline] __run_timers+0xa2e/0xb90 kernel/time/timer.c:1616 run_timer_softirq+0x4c/0xb0 kernel/time/timer.c:1646 __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+0x177/0x710 arch/x86/kernel/apic/apic.c:1048 apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:770 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:814 [inline] RIP: 0010:lock_acquire+0x256/0x580 kernel/locking/lockdep.c:4005 RSP: 0018:ffff8801ce9bea98 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff10 RAX: dffffc0000000000 RBX: ffff8801d0692100 RCX: 0000000000000000 RDX: 1ffffffff0b59305 RSI: 000000009bc4e177 RDI: 0000000000000282 RBP: ffff8801ce9beb90 R08: 0000000000000000 R09: 0000000000000001 R10: 0000000000000000 R11: ffffffff87060ca0 R12: 1ffff10039d37d59 R13: 0000000000000000 R14: 0000000000000002 R15: 0000000000000000 rcu_lock_acquire include/linux/rcupdate.h:244 [inline] rcu_read_lock include/linux/rcupdate.h:630 [inline] __is_insn_slot_addr+0xb4/0x330 kernel/kprobes.c:293 is_kprobe_optinsn_slot include/linux/kprobes.h:344 [inline] __kernel_text_address+0x8f/0xe0 kernel/extable.c:111 unwind_get_return_address+0x61/0xa0 arch/x86/kernel/unwind_frame.c:18 __save_stack_trace+0x7e/0xd0 arch/x86/kernel/stacktrace.c:45 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 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 slab_post_alloc_hook mm/slab.h:444 [inline] slab_alloc_node mm/slab.c:3340 [inline] kmem_cache_alloc_node_trace+0x139/0x760 mm/slab.c:3668 __do_kmalloc_node mm/slab.c:3688 [inline] __kmalloc_node_track_caller+0x33/0x70 mm/slab.c:3703 __kmalloc_reserve.isra.40+0x41/0xd0 net/core/skbuff.c:138 __alloc_skb+0x13b/0x740 net/core/skbuff.c:206 alloc_skb_fclone include/linux/skbuff.h:1018 [inline] sk_stream_alloc_skb+0x10d/0x860 net/ipv4/tcp.c:855 tcp_fragment+0x171/0x12c0 net/ipv4/tcp_output.c:1264 tso_fragment net/ipv4/tcp_output.c:1856 [inline] tcp_write_xmit+0xdd7/0x4960 net/ipv4/tcp_output.c:2333 __tcp_push_pending_frames+0xa0/0x250 net/ipv4/tcp_output.c:2516 tcp_push+0x4e0/0x760 net/ipv4/tcp.c:715 tcp_sendmsg_locked+0x17ad/0x3bc0 net/ipv4/tcp.c:1408 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1445 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xca/0x110 net/socket.c:643 sock_write_iter+0x320/0x5e0 net/socket.c:912 call_write_iter include/linux/fs.h:1770 [inline] new_sync_write fs/read_write.c:468 [inline] __vfs_write+0x68a/0x970 fs/read_write.c:481 vfs_write+0x18f/0x510 fs/read_write.c:543 SYSC_write fs/read_write.c:588 [inline] SyS_write+0xef/0x220 fs/read_write.c:580 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x7f06b3d16370 RSP: 002b:00007ffd7879e9e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000004028 RCX: 00007f06b3d16370 RDX: 0000000000004028 RSI: 0000561d06d13220 RDI: 0000000000000003 RBP: 0000000000000082 R08: 0000000000000001 R09: 6266643636353739 R10: 6435643632643365 R11: 0000000000000246 R12: 000000003c4901a2 R13: 0000000000490000 R14: 00007f06b4dd1c00 R15: 0000561d06cfde30 Allocated by task 8292: 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_node mm/slab.c:3689 [inline] __kmalloc_node+0x47/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:535 [inline] kvmalloc_node+0x64/0xd0 mm/util.c:397 kvmalloc include/linux/mm.h:529 [inline] kvzalloc include/linux/mm.h:537 [inline] alloc_netdev_mqs+0x16e/0xed0 net/core/dev.c:8018 tun_set_iff drivers/net/tun.c:2022 [inline] __tun_chr_ioctl+0x12be/0x3d20 drivers/net/tun.c:2276 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2521 vfs_ioctl fs/ioctl.c:45 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685 SYSC_ioctl fs/ioctl.c:700 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 8292: 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 kvfree+0x36/0x60 mm/util.c:416 netdev_freemem net/core/dev.c:7970 [inline] free_netdev+0x2cf/0x360 net/core/dev.c:8132 tun_set_iff drivers/net/tun.c:2105 [inline] __tun_chr_ioctl+0x2cf6/0x3d20 drivers/net/tun.c:2276 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2521 vfs_ioctl fs/ioctl.c:45 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685 SYSC_ioctl fs/ioctl.c:700 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691 entry_SYSCALL_64_fastpath+0x1f/0xbe The buggy address belongs to the object at ffff8801c2a00c40 which belongs to the cache kmalloc-16384 of size 16384 The buggy address is located 13320 bytes inside of 16384-byte region [ffff8801c2a00c40, ffff8801c2a04c40) The buggy address belongs to the page: page:ffffea00070a8000 count:1 mapcount:0 mapping:ffff8801c2a00c40 index:0x0 compound_mapcount: 0 flags: 0x200000000008100(slab|head) raw: 0200000000008100 ffff8801c2a00c40 0000000000000000 0000000100000001 raw: ffffea000735c620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c2a03f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c2a03f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c2a04000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c2a04080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c2a04100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================