================================================================== BUG: KASAN: use-after-free in nf_hook_slow+0x15c/0x1a0 net/netfilter/core.c:466 Read of size 2 at addr ffff8880984a2600 by task syz-executor.0/12313 CPU: 0 PID: 12313 Comm: syz-executor.0 Not tainted 4.14.225-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351 kasan_report mm/kasan/report.c:409 [inline] __asan_report_load2_noabort+0x68/0x70 mm/kasan/report.c:428 nf_hook_slow+0x15c/0x1a0 net/netfilter/core.c:466 nf_hook include/linux/netfilter.h:205 [inline] NF_HOOK include/linux/netfilter.h:248 [inline] mld_sendpack+0x884/0xea0 net/ipv6/mcast.c:1660 mld_send_cr net/ipv6/mcast.c:1956 [inline] mld_ifc_timer_expire+0x57c/0xcd0 net/ipv6/mcast.c:2455 call_timer_fn+0x14a/0x650 kernel/time/timer.c:1280 expire_timers+0x232/0x4d0 kernel/time/timer.c:1319 __run_timers kernel/time/timer.c:1637 [inline] run_timer_softirq+0x1d5/0x5a0 kernel/time/timer.c:1650 __do_softirq+0x24d/0x9ff kernel/softirq.c:288 invoke_softirq kernel/softirq.c:368 [inline] irq_exit+0x193/0x240 kernel/softirq.c:409 exiting_irq arch/x86/include/asm/apic.h:638 [inline] smp_apic_timer_interrupt+0x141/0x5e0 arch/x86/kernel/apic/apic.c:1106 apic_timer_interrupt+0x93/0xa0 arch/x86/entry/entry_64.S:793 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:779 [inline] RIP: 0010:rcu_read_unlock_special+0x452/0xdd0 kernel/rcu/tree_plugin.h:542 RSP: 0018:ffff888092dc7840 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff10 RAX: 1ffffffff11e1259 RBX: ffff8880598dc680 RCX: 1ffff1100b31b9e5 RDX: dffffc0000000000 RSI: ffff8880598dcf30 RDI: 0000000000000286 RBP: ffff8880598dca04 R08: ffff8880ba52ac30 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000286 R13: ffff8880598dca06 R14: ffff8880598dca05 R15: 0000000000000000 __rcu_read_unlock+0x158/0x160 kernel/rcu/update.c:260 rcu_read_unlock include/linux/rcupdate.h:684 [inline] ipv6_dev_get_saddr+0x236/0x9c0 net/ipv6/addrconf.c:1742 ip6_route_get_saddr include/net/ip6_route.h:111 [inline] ip6_dst_lookup_tail+0x107c/0x16c0 net/ipv6/ip6_output.c:1015 ip6_dst_lookup_flow+0x7c/0x190 net/ipv6/ip6_output.c:1136 ip6_datagram_dst_update+0x50f/0xf60 net/ipv6/datagram.c:91 __ip6_datagram_connect+0x4b4/0xde0 net/ipv6/datagram.c:258 ip6_datagram_connect net/ipv6/datagram.c:281 [inline] ip6_datagram_connect_v6_only+0x5d/0x90 net/ipv6/datagram.c:293 inet_dgram_connect+0x114/0x1f0 net/ipv4/af_inet.c:540 SYSC_connect net/socket.c:1655 [inline] SyS_connect+0x1f4/0x240 net/socket.c:1636 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x465f69 RSP: 002b:00007fcd2cf99188 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465f69 RDX: 000000000000001c RSI: 0000000020000100 RDI: 0000000000000005 RBP: 00000000004bfa8f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007fff15e10a9f R14: 00007fcd2cf99300 R15: 0000000000022000 Allocated by task 11592: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node+0x4c/0x70 mm/slab.c:3689 kmalloc_node include/linux/slab.h:530 [inline] kvmalloc_node+0x46/0xd0 mm/util.c:397 kvmalloc include/linux/mm.h:531 [inline] kvzalloc include/linux/mm.h:539 [inline] allocate_hook_entries_size net/netfilter/core.c:82 [inline] nf_hook_entries_grow net/netfilter/core.c:125 [inline] nf_register_net_hook+0x25d/0xa40 net/netfilter/core.c:277 nf_register_net_hooks+0x47/0xa0 net/netfilter/core.c:382 __ip_vs_dev_init+0x1d/0x30 net/netfilter/ipvs/ip_vs_core.c:2280 ops_init+0xaa/0x3e0 net/core/net_namespace.c:118 setup_net+0x22f/0x530 net/core/net_namespace.c:295 copy_net_ns+0x19b/0x440 net/core/net_namespace.c:419 create_new_namespaces+0x375/0x720 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xa1/0x1d0 kernel/nsproxy.c:206 SYSC_unshare kernel/fork.c:2412 [inline] SyS_unshare+0x308/0x7f0 kernel/fork.c:2362 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 11592: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xc9/0x250 mm/slab.c:3815 kvfree+0x45/0x50 mm/util.c:416 nf_register_net_hook+0x6c2/0xa40 net/netfilter/core.c:296 nf_register_net_hooks+0x47/0xa0 net/netfilter/core.c:382 ip6t_register_table+0x1d3/0x280 net/ipv6/netfilter/ip6_tables.c:1799 ip6table_filter_table_init.part.0+0x88/0xb0 net/ipv6/netfilter/ip6table_filter.c:65 ip6table_filter_table_init+0x4f/0x70 net/ipv6/netfilter/ip6table_filter.c:69 xt_find_table_lock+0x247/0x3d0 net/netfilter/x_tables.c:1110 get_info+0xf5/0x530 net/ipv6/netfilter/ip6_tables.c:983 do_ip6t_get_ctl+0x125/0x7d0 net/ipv6/netfilter/ip6_tables.c:1709 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x62/0xc0 net/netfilter/nf_sockopt.c:122 ipv6_getsockopt+0x146/0x1e0 net/ipv6/ipv6_sockglue.c:1376 tcp_getsockopt+0x7b/0xc0 net/ipv4/tcp.c:3257 SYSC_getsockopt net/socket.c:1896 [inline] SyS_getsockopt+0x102/0x1c0 net/socket.c:1878 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880984a2600 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff8880984a2600, ffff8880984a2640) The buggy address belongs to the page: page:ffffea0002612880 count:1 mapcount:0 mapping:ffff8880984a2000 index:0x0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffff8880984a2000 0000000000000000 0000000100000020 raw: ffffea0002ad50e0 ffffea0002594760 ffff88813fe80340 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880984a2500: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880984a2580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880984a2600: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880984a2680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880984a2700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================