================================================================== 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:1569 [inline] BUG: KASAN: use-after-free in __run_timers+0xa2e/0xb90 kernel/time/timer.c:1616 Write of size 8 at addr ffff88003d93b8c8 by task syz-executor1/9807 CPU: 0 PID: 9807 Comm: syz-executor1 Not tainted 4.13.0-next-20170905+ #15 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: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:577 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:814 [inline] RIP: 0010:kfree+0xf7/0x250 mm/slab.c:3821 RSP: 0018:ffff8800547dfa98 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff10 RAX: 0000000000000007 RBX: ffff88003d3badc0 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000282 RBP: ffff8800547dfab8 R08: ffff88003ec1f340 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000282 R13: ffff88003e8001c0 R14: ffffffff820c314f R15: 0000000000000000 selinux_sk_free_security+0x4f/0x60 security/selinux/hooks.c:4900 security_sk_free+0x48/0x80 security/security.c:1430 sk_prot_free net/core/sock.c:1504 [inline] __sk_destruct+0x609/0x910 net/core/sock.c:1587 sk_destruct+0x47/0x80 net/core/sock.c:1595 __sk_free+0x57/0x230 net/core/sock.c:1603 sk_free+0x2a/0x40 net/core/sock.c:1614 sock_put include/net/sock.h:1649 [inline] sk_common_release+0x1f0/0x2f0 net/core/sock.c:3011 udp_lib_close+0x15/0x20 include/net/udp.h:203 inet_release+0xed/0x1c0 net/ipv4/af_inet.c:425 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:433 sock_release+0x8d/0x1e0 net/socket.c:597 SYSC_socketpair net/socket.c:1447 [inline] SyS_socketpair+0x4ae/0x640 net/socket.c:1353 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x447299 RSP: 002b:00007efc07423c08 EFLAGS: 00000296 ORIG_RAX: 0000000000000035 RAX: ffffffffffffffda RBX: 000000000000000a RCX: 0000000000447299 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 000000000000000a RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020836ff8 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 00007efc074249c0 R15: 00007efc07424700 Allocated by task 9595: 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_track_caller+0x47/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 include/linux/skbuff.h:976 [inline] netlink_dump+0x2ba/0xb90 net/netlink/af_netlink.c:2154 __netlink_dump_start+0x4ce/0x6e0 net/netlink/af_netlink.c:2268 netlink_dump_start include/linux/netlink.h:216 [inline] rtnetlink_rcv_msg+0x977/0x1090 net/core/rtnetlink.c:4216 netlink_rcv_skb+0x216/0x440 net/netlink/af_netlink.c:2397 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4258 netlink_unicast_kernel net/netlink/af_netlink.c:1265 [inline] netlink_unicast+0x4e8/0x6f0 net/netlink/af_netlink.c:1291 netlink_sendmsg+0xa4a/0xe70 net/netlink/af_netlink.c:1854 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xca/0x110 net/socket.c:643 SYSC_sendto+0x358/0x5a0 net/socket.c:1750 SyS_sendto+0x40/0x50 net/socket.c:1718 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 9595: 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 skb_free_head+0x74/0xb0 net/core/skbuff.c:554 skb_release_data+0x58c/0x790 net/core/skbuff.c:574 skb_release_all+0x4a/0x60 net/core/skbuff.c:631 __kfree_skb net/core/skbuff.c:645 [inline] consume_skb+0x153/0x490 net/core/skbuff.c:705 skb_free_datagram+0x1a/0xe0 net/core/datagram.c:330 netlink_recvmsg+0x5c6/0x1300 net/netlink/af_netlink.c:1933 sock_recvmsg_nosec net/socket.c:806 [inline] sock_recvmsg+0xc9/0x110 net/socket.c:813 ___sys_recvmsg+0x29b/0x630 net/socket.c:2208 __sys_recvmsg+0xe2/0x210 net/socket.c:2253 SYSC_recvmsg net/socket.c:2265 [inline] SyS_recvmsg+0x2d/0x50 net/socket.c:2260 entry_SYSCALL_64_fastpath+0x1f/0xbe The buggy address belongs to the object at ffff88003d9384c0 which belongs to the cache kmalloc-16384 of size 16384 The buggy address is located 13320 bytes inside of 16384-byte region [ffff88003d9384c0, ffff88003d93c4c0) The buggy address belongs to the page: page:ffffea0000f64e00 count:1 mapcount:0 mapping:ffff88003d9384c0 index:0x0 compound_mapcount: 0 flags: 0x100000000008100(slab|head) raw: 0100000000008100 ffff88003d9384c0 0000000000000000 0000000100000001 raw: ffffea0000d5e820 ffffea00009f6420 ffff88003e802200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88003d93b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88003d93b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88003d93b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88003d93b900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88003d93b980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================