batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready print_req_error: I/O error, dev loop2, sector 0 ================================================================== BUG: KASAN: use-after-free in nf_hook_slow+0x197/0x1a0 net/netfilter/core.c:467 Read of size 2 at addr ffff8880af3c6c00 by task syz-executor.4/9480 CPU: 0 PID: 9480 Comm: syz-executor.4 Not tainted 4.14.290-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 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+0x197/0x1a0 net/netfilter/core.c:467 nf_hook include/linux/netfilter.h:205 [inline] NF_HOOK include/linux/netfilter.h:248 [inline] ndisc_send_skb+0xcf9/0x1390 net/ipv6/ndisc.c:483 ndisc_send_rs+0x125/0x630 net/ipv6/ndisc.c:677 addrconf_rs_timer+0x2bb/0x5a0 net/ipv6/addrconf.c:3773 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:ffff8880573aefe0 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff10 RAX: 1ffffffff11e1341 RBX: ffff8880af35c380 RCX: 1ffff11015e6b985 RDX: dffffc0000000000 RSI: ffff8880af35cc30 RDI: 0000000000000286 RBP: ffff8880af35c704 R08: ffff8880ba534d30 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000286 R13: ffff8880af35c706 R14: ffff8880af35c705 R15: 0000000000000000 __rcu_read_unlock+0x158/0x160 kernel/rcu/update.c:260 rcu_read_unlock include/linux/rcupdate.h:684 [inline] ip_route_output_key_hash+0x1b9/0x2a0 net/ipv4/route.c:2367 __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x23/0x130 net/ipv4/route.c:2623 ip_route_output_key include/net/route.h:136 [inline] sctp_v4_get_dst+0x333/0xfb0 net/sctp/protocol.c:470 sctp_transport_route+0xa1/0x410 net/sctp/transport.c:305 sctp_assoc_add_peer+0x4e9/0x10e0 net/sctp/associola.c:661 sctp_process_param net/sctp/sm_make_chunk.c:2539 [inline] sctp_process_init+0x2167/0x2780 net/sctp/sm_make_chunk.c:2362 sctp_sf_do_unexpected_init.isra.0+0x5bf/0x10e0 net/sctp/sm_statefuns.c:1534 sctp_do_sm+0x13d/0x4c70 net/sctp/sm_sideeffect.c:1151 sctp_assoc_bh_rcv+0x2a2/0x5d0 net/sctp/associola.c:1096 sctp_inq_push+0x1be/0x250 net/sctp/inqueue.c:95 sctp_backlog_rcv+0x110/0x860 net/sctp/input.c:352 sk_backlog_rcv include/net/sock.h:923 [inline] __release_sock+0x12a/0x350 net/core/sock.c:2284 release_sock+0x54/0x1b0 net/core/sock.c:2822 sctp_wait_for_connect+0x27a/0x470 net/sctp/socket.c:8019 sctp_sendmsg+0x29eb/0x2f30 net/sctp/socket.c:2073 inet_sendmsg+0x11a/0x4e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 SYSC_sendto net/socket.c:1763 [inline] SyS_sendto+0x1c7/0x2c0 net/socket.c:1731 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7f3b351b6279 RSP: 002b:00007f3b33b2b168 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f3b352c8f80 RCX: 00007f3b351b6279 RDX: 0000000000000001 RSI: 00000000203cef9f RDI: 0000000000000005 RBP: 00007f3b35210189 R08: 0000000020618000 R09: 0000000000000010 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffd48ba88f R14: 00007f3b33b2b300 R15: 0000000000022000 Allocated by task 8023: 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:430 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:383 ip6t_register_table+0x1d3/0x280 net/ipv6/netfilter/ip6_tables.c:1802 ip6table_raw_table_init net/ipv6/netfilter/ip6table_raw.c:44 [inline] ip6table_raw_table_init+0x82/0xc0 net/ipv6/netfilter/ip6table_raw.c:33 xt_find_table_lock+0x247/0x3d0 net/netfilter/x_tables.c:1106 get_info+0xf5/0x530 net/ipv6/netfilter/ip6_tables.c:984 do_ip6t_get_ctl+0x125/0x7d0 net/ipv6/netfilter/ip6_tables.c:1712 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:3259 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 Freed by task 8023: 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:449 nf_register_net_hook+0x6c2/0xa40 net/netfilter/core.c:297 nf_register_net_hooks+0x47/0xa0 net/netfilter/core.c:383 ip6t_register_table+0x1d3/0x280 net/ipv6/netfilter/ip6_tables.c:1802 ip6table_security_table_init net/ipv6/netfilter/ip6table_security.c:61 [inline] ip6table_security_table_init+0x82/0xc0 net/ipv6/netfilter/ip6table_security.c:50 xt_find_table_lock+0x247/0x3d0 net/netfilter/x_tables.c:1106 get_info+0xf5/0x530 net/ipv6/netfilter/ip6_tables.c:984 do_ip6t_get_ctl+0x125/0x7d0 net/ipv6/netfilter/ip6_tables.c:1712 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:3259 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 ffff8880af3c6c00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes inside of 128-byte region [ffff8880af3c6c00, ffff8880af3c6c80) The buggy address belongs to the page: page:ffffea0002bcf180 count:1 mapcount:0 mapping:ffff8880af3c6000 index:0x0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffff8880af3c6000 0000000000000000 0000000100000015 raw: ffffea0002bd1620 ffff88813fe64548 ffff88813fe74640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880af3c6b00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880af3c6b80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff8880af3c6c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880af3c6c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8880af3c6d00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================