================================================================== BUG: KASAN: slab-out-of-bounds in dst_dev_put+0x266/0x290 net/core/dst.c:175 Read of size 8 at addr ffff88808c748b48 by task syz-executor.4/29654 CPU: 1 PID: 29654 Comm: syz-executor.4 Not tainted 5.0.0-rc7+ #84 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 dst_dev_put+0x266/0x290 net/core/dst.c:175 rt_cache_route+0x29f/0x310 net/ipv4/route.c:1441 rt_set_nexthop.constprop.0+0x405/0x11d0 net/ipv4/route.c:1541 __mkroute_output net/ipv4/route.c:2297 [inline] ip_route_output_key_hash_rcu+0xa52/0x30e0 net/ipv4/route.c:2496 ip_route_output_key_hash+0x212/0x380 net/ipv4/route.c:2325 __ip_route_output_key include/net/route.h:124 [inline] ip_route_connect include/net/route.h:302 [inline] tcp_v4_connect+0x7ec/0x1c40 net/ipv4/tcp_ipv4.c:233 __inet_stream_connect+0x83f/0xea0 net/ipv4/af_inet.c:655 tcp_sendmsg_fastopen net/ipv4/tcp.c:1163 [inline] tcp_sendmsg_locked+0x2347/0x34b0 net/ipv4/tcp.c:1205 tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1441 inet_sendmsg+0x147/0x5d0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 __sys_sendto+0x262/0x380 net/socket.c:1808 __do_sys_sendto net/socket.c:1820 [inline] __se_sys_sendto net/socket.c:1816 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1816 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457e29 Code: ad b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fec09540c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000457e29 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000073bf00 R08: 00000000200000c0 R09: 0000000000000010 R10: 0000000020000804 R11: 0000000000000246 R12: 00007fec095416d4 R13: 00000000004c5551 R14: 00000000004d9488 R15: 00000000ffffffff Allocated by task 7730: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:495 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:468 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:509 kmem_cache_alloc_node_trace+0x153/0x720 mm/slab.c:3657 kmalloc_node include/linux/slab.h:583 [inline] kzalloc_node include/linux/slab.h:751 [inline] __get_vm_area_node+0x12b/0x3a0 mm/vmalloc.c:1389 __vmalloc_node_range+0xd4/0x790 mm/vmalloc.c:1745 __vmalloc_node mm/vmalloc.c:1795 [inline] __vmalloc_node_flags mm/vmalloc.c:1809 [inline] vzalloc+0x6b/0x90 mm/vmalloc.c:1848 alloc_counters.isra.0+0x53/0x680 net/ipv4/netfilter/ip_tables.c:803 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:825 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1027 [inline] do_ipt_get_ctl+0x4fc/0x930 net/ipv4/netfilter/ip_tables.c:1703 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x80/0xe0 net/netfilter/nf_sockopt.c:122 ip_getsockopt net/ipv4/ip_sockglue.c:1574 [inline] ip_getsockopt+0x176/0x1d0 net/ipv4/ip_sockglue.c:1554 tcp_getsockopt net/ipv4/tcp.c:3631 [inline] tcp_getsockopt+0x95/0xf0 net/ipv4/tcp.c:3625 sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:3065 __sys_getsockopt+0x168/0x250 net/socket.c:1959 __do_sys_getsockopt net/socket.c:1970 [inline] __se_sys_getsockopt net/socket.c:1967 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:1967 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7730: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:457 kasan_slab_free+0xe/0x10 mm/kasan/common.c:465 __cache_free mm/slab.c:3494 [inline] kfree+0xcf/0x230 mm/slab.c:3811 __vunmap+0x2ee/0x400 mm/vmalloc.c:1532 vfree+0x8d/0x140 mm/vmalloc.c:1597 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:870 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1027 [inline] do_ipt_get_ctl+0x71a/0x930 net/ipv4/netfilter/ip_tables.c:1703 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x80/0xe0 net/netfilter/nf_sockopt.c:122 ip_getsockopt net/ipv4/ip_sockglue.c:1574 [inline] ip_getsockopt+0x176/0x1d0 net/ipv4/ip_sockglue.c:1554 tcp_getsockopt net/ipv4/tcp.c:3631 [inline] tcp_getsockopt+0x95/0xf0 net/ipv4/tcp.c:3625 sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:3065 __sys_getsockopt+0x168/0x250 net/socket.c:1959 __do_sys_getsockopt net/socket.c:1970 [inline] __se_sys_getsockopt net/socket.c:1967 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:1967 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808c748b00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes to the right of 64-byte region [ffff88808c748b00, ffff88808c748b40) The buggy address belongs to the page: page:ffffea000231d200 count:1 mapcount:0 mapping:ffff88812c3f0340 index:0xffff88808c748180 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0001623bc8 ffffea0002850e88 ffff88812c3f0340 raw: ffff88808c748180 ffff88808c748000 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808c748a00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808c748a80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808c748b00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88808c748b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808c748c00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================