================================================================== BUG: KASAN: use-after-free in atomic_dec_return include/asm-generic/atomic-instrumented.h:198 [inline] BUG: KASAN: use-after-free in dst_release+0x2a/0xb0 net/core/dst.c:185 Write of size 4 at addr ffff8801cf5b1340 by task syz-executor1/14002 CPU: 0 PID: 14002 Comm: syz-executor1 Not tainted 4.16.0+ #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 netlink: 'syz-executor0': attribute type 1 has an invalid length. Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b9/0x29f lib/dump_stack.c:53 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0xac/0x2f5 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 kasan_check_write+0x14/0x20 mm/kasan/kasan.c:278 atomic_dec_return include/asm-generic/atomic-instrumented.h:198 [inline] dst_release+0x2a/0xb0 net/core/dst.c:185 sk_dst_set include/net/sock.h:1817 [inline] sk_dst_reset include/net/sock.h:1829 [inline] sock_setbindtodevice net/core/sock.c:610 [inline] sock_setsockopt+0x4e0/0x1f40 net/core/sock.c:707 __sys_setsockopt+0x2df/0x390 net/socket.c:1899 SYSC_setsockopt net/socket.c:1914 [inline] SyS_setsockopt+0x34/0x50 net/socket.c:1911 do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287 IPVS: ftp: loaded support on port[0] = 21 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x455259 RSP: 002b:00007f09aa342c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f09aa3436d4 RCX: 0000000000455259 RDX: 0000000000000019 RSI: 0000000000000001 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 0000000000000010 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000052b R14: 00000000006faca8 R15: 0000000000000000 Allocated by task 14002: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:552 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3542 dst_alloc+0xbb/0x1d0 net/core/dst.c:104 rt_dst_alloc+0xfa/0x500 net/ipv4/route.c:1520 __mkroute_output net/ipv4/route.c:2258 [inline] ip_route_output_key_hash_rcu+0xd23/0x3440 net/ipv4/route.c:2484 ip_route_output_key_hash+0x23d/0x3a0 net/ipv4/route.c:2313 __ip_route_output_key include/net/route.h:124 [inline] ip_route_output_flow+0x28/0xc0 net/ipv4/route.c:2568 IPVS: ftp: loaded support on port[0] = 21 ip_route_output_ports include/net/route.h:161 [inline] pptp_connect+0xc93/0x189c drivers/net/ppp/pptp.c:453 __sys_connect+0x37d/0x4c0 net/socket.c:1665 SYSC_connect net/socket.c:1676 [inline] SyS_connect+0x24/0x30 net/socket.c:1673 do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 13998: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3486 [inline] kmem_cache_free+0x86/0x2d0 mm/slab.c:3744 dst_destroy+0x267/0x3c0 net/core/dst.c:140 dst_destroy_rcu+0x16/0x20 net/core/dst.c:153 __rcu_reclaim kernel/rcu/rcu.h:178 [inline] rcu_do_batch kernel/rcu/tree.c:2675 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2930 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2897 [inline] rcu_process_callbacks+0x941/0x15f0 kernel/rcu/tree.c:2914 __do_softirq+0x2e0/0xaf5 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801cf5b1300 which belongs to the cache ip_dst_cache of size 160 The buggy address is located 64 bytes inside of 160-byte region [ffff8801cf5b1300, ffff8801cf5b13a0) The buggy address belongs to the page: page:ffffea00073d6c40 count:1 mapcount:0 mapping:ffff8801cf5b1000 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801cf5b1000 0000000000000000 0000000100000010 raw: ffffea0006f850a0 ffffea0007115d60 ffff8801d4efe500 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801cf5b1200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801cf5b1280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801cf5b1300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801cf5b1380: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff8801cf5b1400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================