================================================================== BUG: KASAN: use-after-free in instrument_atomic_write include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:220 [inline] BUG: KASAN: use-after-free in refcount_sub_and_test include/linux/refcount.h:266 [inline] BUG: KASAN: use-after-free in refcount_dec_and_test include/linux/refcount.h:294 [inline] BUG: KASAN: use-after-free in xp_put_pool+0x2c/0x1e0 net/xdp/xsk_buff_pool.c:262 Write of size 4 at addr ffff8880a0af5060 by task ksoftirqd/1/16 CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.9.0-rc3-syzkaller #0 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+0x198/0x1fd lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:192 instrument_atomic_write include/linux/instrumented.h:71 [inline] atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:220 [inline] refcount_sub_and_test include/linux/refcount.h:266 [inline] refcount_dec_and_test include/linux/refcount.h:294 [inline] xp_put_pool+0x2c/0x1e0 net/xdp/xsk_buff_pool.c:262 xsk_destruct+0x7d/0xa0 net/xdp/xsk.c:1138 __sk_destruct+0x4b/0x860 net/core/sock.c:1764 rcu_do_batch kernel/rcu/tree.c:2428 [inline] rcu_core+0x5ca/0x1130 kernel/rcu/tree.c:2656 __do_softirq+0x1f7/0xa91 kernel/softirq.c:298 run_ksoftirqd kernel/softirq.c:652 [inline] run_ksoftirqd+0xcf/0x170 kernel/softirq.c:644 smpboot_thread_fn+0x655/0x9e0 kernel/smpboot.c:165 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 31710: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 kmalloc_node include/linux/slab.h:577 [inline] kvmalloc_node+0x61/0xf0 mm/util.c:574 kvmalloc include/linux/mm.h:755 [inline] kvzalloc include/linux/mm.h:763 [inline] xp_create_and_assign_umem+0x58/0x8d0 net/xdp/xsk_buff_pool.c:54 xsk_bind+0x9a0/0xed0 net/xdp/xsk.c:709 __sys_bind+0x1e9/0x250 net/socket.c:1656 __do_sys_bind net/socket.c:1667 [inline] __se_sys_bind net/socket.c:1665 [inline] __x64_sys_bind+0x6f/0xb0 net/socket.c:1665 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 31710: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kfree+0x10e/0x2b0 mm/slab.c:3756 kvfree+0x42/0x50 mm/util.c:603 xp_destroy net/xdp/xsk_buff_pool.c:44 [inline] xp_destroy+0x45/0x60 net/xdp/xsk_buff_pool.c:38 xsk_bind+0xbdd/0xed0 net/xdp/xsk.c:719 __sys_bind+0x1e9/0x250 net/socket.c:1656 __do_sys_bind net/socket.c:1667 [inline] __se_sys_bind net/socket.c:1665 [inline] __x64_sys_bind+0x6f/0xb0 net/socket.c:1665 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x82/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2894 [inline] call_rcu+0x15e/0x7b0 kernel/rcu/tree.c:2968 in6_dev_finish_destroy+0x143/0x1b0 net/ipv6/addrconf_core.c:264 in6_dev_put include/net/addrconf.h:379 [inline] addrconf_ifdown.isra.0+0x12a3/0x1570 net/ipv6/addrconf.c:3848 addrconf_notify+0x55c/0x2310 net/ipv6/addrconf.c:3627 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2033 call_netdevice_notifiers_extack net/core/dev.c:2045 [inline] call_netdevice_notifiers net/core/dev.c:2059 [inline] rollback_registered_many+0x768/0x1210 net/core/dev.c:9284 unregister_netdevice_many.part.0+0x1a/0x2f0 net/core/dev.c:10429 unregister_netdevice_many+0x36/0x50 net/core/dev.c:10428 mroute_clean_tables+0x20c/0xac0 net/ipv6/ip6mr.c:1514 ip6mr_sk_done+0x2ea/0x370 net/ipv6/ip6mr.c:1599 ip6_mroute_setsockopt+0x974/0x1c60 net/ipv6/ip6mr.c:1664 do_ipv6_setsockopt.constprop.0+0x34a/0x4140 net/ipv6/ipv6_sockglue.c:414 ipv6_setsockopt+0xd6/0x180 net/ipv6/ipv6_sockglue.c:1003 rawv6_setsockopt+0xd8/0x690 net/ipv6/raw.c:1081 __sys_setsockopt+0x2db/0x610 net/socket.c:2132 __do_sys_setsockopt net/socket.c:2143 [inline] __se_sys_setsockopt net/socket.c:2140 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2140 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Second to last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x82/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2894 [inline] call_rcu+0x15e/0x7b0 kernel/rcu/tree.c:2968 sctp_transport_destroy net/sctp/transport.c:167 [inline] sctp_transport_put+0x11d/0x180 net/sctp/transport.c:326 sctp_association_free+0x4c7/0x7b0 net/sctp/associola.c:379 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:930 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1318 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1185 [inline] sctp_do_sm+0x3838/0x4d80 net/sctp/sm_sideeffect.c:1156 sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1044 sctp_inq_push+0x1da/0x270 net/sctp/inqueue.c:80 sctp_backlog_rcv+0x19e/0x5c0 net/sctp/input.c:344 sk_backlog_rcv include/net/sock.h:1011 [inline] __release_sock+0x134/0x3a0 net/core/sock.c:2528 release_sock+0x54/0x1b0 net/core/sock.c:3051 sctp_close+0x438/0x8b0 net/sctp/socket.c:1519 inet_release+0x12e/0x280 net/ipv4/af_inet.c:431 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:475 __sock_release+0xcd/0x280 net/socket.c:596 sock_close+0x18/0x20 net/socket.c:1277 __fput+0x285/0x920 fs/file_table.c:281 task_work_run+0xdd/0x190 kernel/task_work.c:141 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:140 [inline] exit_to_user_mode_prepare+0x1e1/0x200 kernel/entry/common.c:167 syscall_exit_to_user_mode+0x7e/0x2e0 kernel/entry/common.c:242 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8880a0af5000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 96 bytes inside of 1024-byte region [ffff8880a0af5000, ffff8880a0af5400) The buggy address belongs to the page: page:000000006f0484bd refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xa0af5 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea000247ff48 ffffea00024d24c8 ffff8880aa040700 raw: 0000000000000000 ffff8880a0af5000 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a0af4f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a0af4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a0af5000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a0af5080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a0af5100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================