==================================================================
BUG: KASAN: use-after-free in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:664
Read of size 8 at addr ffff88805bc5e5e8 by task kworker/0:2/917
CPU: 0 PID: 917 Comm: kworker/0:2 Not tainted 5.17.0-rc2-syzkaller-00177-gf8d9d938514f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events nsim_dev_trap_report_work
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255
__kasan_report mm/kasan/report.c:442 [inline]
kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:664
sk_error_report+0x35/0x310 net/core/sock.c:340
tcp_write_err net/ipv4/tcp_timer.c:71 [inline]
tcp_write_timeout net/ipv4/tcp_timer.c:276 [inline]
tcp_retransmit_timer+0x20c2/0x3320 net/ipv4/tcp_timer.c:512
tcp_ld_RTO_revert net/ipv4/tcp_ipv4.c:442 [inline]
tcp_ld_RTO_revert+0x4fa/0x630 net/ipv4/tcp_ipv4.c:408
tcp_v4_err+0x1581/0x1760 net/ipv4/tcp_ipv4.c:568
icmp_socket_deliver+0x1c1/0x360 net/ipv4/icmp.c:833
icmp_unreach+0x339/0xc40 net/ipv4/icmp.c:950
icmp_rcv+0xf8b/0x1ef0 net/ipv4/icmp.c:1261
ip_protocol_deliver_rcu+0xa3/0xf30 net/ipv4/ip_input.c:204
ip_local_deliver_finish+0x20a/0x370 net/ipv4/ip_input.c:231
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ip_local_deliver+0x1b3/0x200 net/ipv4/ip_input.c:252
dst_input include/net/dst.h:461 [inline]
ip_rcv_finish+0x1cb/0x2f0 net/ipv4/ip_input.c:429
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ip_rcv+0xaa/0xd0 net/ipv4/ip_input.c:540
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351
__netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465
process_backlog+0x2a5/0x6c0 net/core/dev.c:5797
__napi_poll+0xaf/0x440 net/core/dev.c:6365
napi_poll net/core/dev.c:6432 [inline]
net_rx_action+0x801/0xb40 net/core/dev.c:6519
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
do_softirq.part.0+0xde/0x130 kernel/softirq.c:459
do_softirq kernel/softirq.c:451 [inline]
__local_bh_enable_ip+0x102/0x120 kernel/softirq.c:383
spin_unlock_bh include/linux/spinlock.h:394 [inline]
nsim_dev_trap_report drivers/net/netdevsim/dev.c:817 [inline]
nsim_dev_trap_report_work+0x855/0xbc0 drivers/net/netdevsim/dev.c:843
process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307
worker_thread+0x657/0x1110 kernel/workqueue.c:2454
kthread+0x2e9/0x3a0 kernel/kthread.c:377
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Allocated by task 26499:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:436 [inline]
____kasan_kmalloc mm/kasan/common.c:515 [inline]
____kasan_kmalloc mm/kasan/common.c:474 [inline]
__kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524
kmalloc include/linux/slab.h:581 [inline]
kzalloc include/linux/slab.h:715 [inline]
snmp6_alloc_dev net/ipv6/addrconf.c:360 [inline]
ipv6_add_dev+0x57c/0x11a0 net/ipv6/addrconf.c:410
addrconf_notify+0x60e/0x1ba0 net/ipv6/addrconf.c:3523
notifier_call_chain+0xb5/0x200 kernel/notifier.c:84
call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919
call_netdevice_notifiers_extack net/core/dev.c:1931 [inline]
call_netdevice_notifiers net/core/dev.c:1945 [inline]
register_netdevice+0x1073/0x1500 net/core/dev.c:9698
register_netdev+0x2d/0x50 net/core/dev.c:9791
vti6_init_net+0x449/0x860 net/ipv6/ip6_vti.c:1164
ops_init+0xaf/0x470 net/core/net_namespace.c:140
setup_net+0x554/0xbb0 net/core/net_namespace.c:330
copy_net_ns+0x318/0x760 net/core/net_namespace.c:474
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x445/0x920 kernel/fork.c:3048
__do_sys_unshare kernel/fork.c:3119 [inline]
__se_sys_unshare kernel/fork.c:3117 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3117
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Freed by task 3633:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track+0x21/0x30 mm/kasan/common.c:45
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370
____kasan_slab_free mm/kasan/common.c:366 [inline]
____kasan_slab_free+0x130/0x160 mm/kasan/common.c:328
kasan_slab_free include/linux/kasan.h:236 [inline]
slab_free_hook mm/slub.c:1728 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754
slab_free mm/slub.c:3509 [inline]
kfree+0xcb/0x280 mm/slub.c:4562
snmp6_free_dev net/ipv6/addrconf_core.c:240 [inline]
in6_dev_finish_destroy_rcu+0x35/0xa0 net/ipv6/addrconf_core.c:249
rcu_do_batch kernel/rcu/tree.c:2527 [inline]
rcu_core+0x7b8/0x1540 kernel/rcu/tree.c:2778
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
The buggy address belongs to the object at ffff88805bc5e000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 1512 bytes inside of
4096-byte region [ffff88805bc5e000, ffff88805bc5f000)
The buggy address belongs to the page:
page:ffffea00016f1600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5bc58
head:ffffea00016f1600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888010c42140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 26499, ts 1413852612797, free_ts 1413660076398
prep_new_page mm/page_alloc.c:2434 [inline]
get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389
alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271
alloc_slab_page mm/slub.c:1799 [inline]
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x28a/0x3b0 mm/slub.c:2004
___slab_alloc+0x87c/0xe90 mm/slub.c:3018
__slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105
slab_alloc_node mm/slub.c:3196 [inline]
slab_alloc mm/slub.c:3238 [inline]
kmem_cache_alloc_trace+0x289/0x2c0 mm/slub.c:3255
kmalloc include/linux/slab.h:581 [inline]
kzalloc include/linux/slab.h:715 [inline]
kobject_uevent_env+0x235/0x1600 lib/kobject_uevent.c:524
rx_queue_add_kobject net/core/net-sysfs.c:1061 [inline]
net_rx_queue_update_kobjects+0xe9/0x510 net/core/net-sysfs.c:1101
register_queue_kobjects net/core/net-sysfs.c:1761 [inline]
netdev_register_kobject+0x275/0x430 net/core/net-sysfs.c:2012
register_netdevice+0xd31/0x1500 net/core/dev.c:9667
register_netdev+0x2d/0x50 net/core/dev.c:9791
vti6_init_net+0x449/0x860 net/ipv6/ip6_vti.c:1164
ops_init+0xaf/0x470 net/core/net_namespace.c:140
setup_net+0x554/0xbb0 net/core/net_namespace.c:330
copy_net_ns+0x318/0x760 net/core/net_namespace.c:474
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1352 [inline]
free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404
free_unref_page_prepare mm/page_alloc.c:3325 [inline]
free_unref_page+0x19/0x690 mm/page_alloc.c:3404
qlink_free mm/kasan/quarantine.c:157 [inline]
qlist_free_all+0x6d/0x160 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446
kasan_slab_alloc include/linux/kasan.h:260 [inline]
slab_post_alloc_hook mm/slab.h:732 [inline]
slab_alloc_node mm/slub.c:3230 [inline]
slab_alloc mm/slub.c:3238 [inline]
kmem_cache_alloc_trace+0x1e9/0x2c0 mm/slub.c:3255
kmalloc include/linux/slab.h:581 [inline]
kzalloc include/linux/slab.h:715 [inline]
mpls_add_dev net/mpls/af_mpls.c:1455 [inline]
mpls_dev_notify+0x11e/0x8a0 net/mpls/af_mpls.c:1612
notifier_call_chain+0xb5/0x200 kernel/notifier.c:84
call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919
call_netdevice_notifiers_extack net/core/dev.c:1931 [inline]
call_netdevice_notifiers net/core/dev.c:1945 [inline]
register_netdevice+0x1073/0x1500 net/core/dev.c:9698
register_netdev+0x2d/0x50 net/core/dev.c:9791
loopback_net_init+0x73/0x160 drivers/net/loopback.c:217
ops_init+0xaf/0x470 net/core/net_namespace.c:140
setup_net+0x554/0xbb0 net/core/net_namespace.c:330
copy_net_ns+0x318/0x760 net/core/net_namespace.c:474
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
Memory state around the buggy address:
ffff88805bc5e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88805bc5e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805bc5e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88805bc5e600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88805bc5e680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================