2097051 pages RAM 0 pages HighMem/MovableOnly 384520 pages reserved 0 pages cma reserved ================================================================== BUG: KASAN: use-after-free in rxe_queue_cleanup+0xf4/0x100 drivers/infiniband/sw/rxe/rxe_queue.c:193 Read of size 8 at addr ffff88807a6dda90 by task syz-executor.4/2097 CPU: 1 PID: 2097 Comm: syz-executor.4 Not tainted 5.16.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 rxe_queue_cleanup+0xf4/0x100 drivers/infiniband/sw/rxe/rxe_queue.c:193 rxe_qp_do_cleanup+0x5d/0xa60 drivers/infiniband/sw/rxe/rxe_qp.c:804 execute_in_process_context+0x37/0x150 kernel/workqueue.c:3359 rxe_elem_release+0x9f/0x180 drivers/infiniband/sw/rxe/rxe_pool.c:407 kref_put include/linux/kref.h:65 [inline] rxe_create_qp+0x32c/0x3b0 drivers/infiniband/sw/rxe/rxe_verbs.c:450 create_qp+0x50c/0x880 drivers/infiniband/core/verbs.c:1238 ib_create_qp_kernel+0x9d/0x310 drivers/infiniband/core/verbs.c:1349 ib_create_qp include/rdma/ib_verbs.h:3722 [inline] create_mad_qp+0x177/0x2d0 drivers/infiniband/core/mad.c:2910 ib_mad_port_open drivers/infiniband/core/mad.c:2991 [inline] ib_mad_init_device+0xd4d/0x13f0 drivers/infiniband/core/mad.c:3082 add_client_context+0x405/0x5e0 drivers/infiniband/core/device.c:720 enable_device_and_get+0x1cd/0x3b0 drivers/infiniband/core/device.c:1331 ib_register_device drivers/infiniband/core/device.c:1419 [inline] ib_register_device+0x854/0xb50 drivers/infiniband/core/device.c:1365 rxe_register_device+0x2fe/0x3b0 drivers/infiniband/sw/rxe/rxe_verbs.c:1146 rxe_add+0x1331/0x1710 drivers/infiniband/sw/rxe/rxe.c:248 rxe_net_add+0x8c/0xe0 drivers/infiniband/sw/rxe/rxe_net.c:543 rxe_newlink drivers/infiniband/sw/rxe/rxe.c:270 [inline] rxe_newlink+0xa9/0xd0 drivers/infiniband/sw/rxe/rxe.c:251 nldev_newlink+0x30a/0x560 drivers/infiniband/core/nldev.c:1717 rdma_nl_rcv_msg+0x36d/0x690 drivers/infiniband/core/netlink.c:195 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x2ee/0x430 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1341 netlink_sendmsg+0x86d/0xda0 net/netlink/af_netlink.c:1912 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492 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 RIP: 0033:0x7f24bfcf5ae9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f24bd26b188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f24bfe08f60 RCX: 00007f24bfcf5ae9 RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000004 RBP: 00007f24bfd4ff6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffff362175f R14: 00007f24bd26b300 R15: 0000000000022000 Allocated by task 2097: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] rxe_queue_init+0x99/0x510 drivers/infiniband/sw/rxe/rxe_queue.c:66 rxe_qp_init_req drivers/infiniband/sw/rxe/rxe_qp.c:233 [inline] rxe_qp_from_init+0x844/0x1bf0 drivers/infiniband/sw/rxe/rxe_qp.c:347 rxe_create_qp+0x231/0x3b0 drivers/infiniband/sw/rxe/rxe_verbs.c:442 create_qp+0x50c/0x880 drivers/infiniband/core/verbs.c:1238 ib_create_qp_kernel+0x9d/0x310 drivers/infiniband/core/verbs.c:1349 ib_create_qp include/rdma/ib_verbs.h:3722 [inline] create_mad_qp+0x177/0x2d0 drivers/infiniband/core/mad.c:2910 ib_mad_port_open drivers/infiniband/core/mad.c:2991 [inline] ib_mad_init_device+0xd4d/0x13f0 drivers/infiniband/core/mad.c:3082 add_client_context+0x405/0x5e0 drivers/infiniband/core/device.c:720 enable_device_and_get+0x1cd/0x3b0 drivers/infiniband/core/device.c:1331 ib_register_device drivers/infiniband/core/device.c:1419 [inline] ib_register_device+0x854/0xb50 drivers/infiniband/core/device.c:1365 rxe_register_device+0x2fe/0x3b0 drivers/infiniband/sw/rxe/rxe_verbs.c:1146 rxe_add+0x1331/0x1710 drivers/infiniband/sw/rxe/rxe.c:248 rxe_net_add+0x8c/0xe0 drivers/infiniband/sw/rxe/rxe_net.c:543 rxe_newlink drivers/infiniband/sw/rxe/rxe.c:270 [inline] rxe_newlink+0xa9/0xd0 drivers/infiniband/sw/rxe/rxe.c:251 nldev_newlink+0x30a/0x560 drivers/infiniband/core/nldev.c:1717 rdma_nl_rcv_msg+0x36d/0x690 drivers/infiniband/core/netlink.c:195 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x2ee/0x430 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1341 netlink_sendmsg+0x86d/0xda0 net/netlink/af_netlink.c:1912 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492 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 2097: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kfree+0xf6/0x560 mm/slub.c:4561 rxe_qp_from_init+0x161e/0x1bf0 drivers/infiniband/sw/rxe/rxe_qp.c:361 rxe_create_qp+0x231/0x3b0 drivers/infiniband/sw/rxe/rxe_verbs.c:442 create_qp+0x50c/0x880 drivers/infiniband/core/verbs.c:1238 ib_create_qp_kernel+0x9d/0x310 drivers/infiniband/core/verbs.c:1349 ib_create_qp include/rdma/ib_verbs.h:3722 [inline] create_mad_qp+0x177/0x2d0 drivers/infiniband/core/mad.c:2910 ib_mad_port_open drivers/infiniband/core/mad.c:2991 [inline] ib_mad_init_device+0xd4d/0x13f0 drivers/infiniband/core/mad.c:3082 add_client_context+0x405/0x5e0 drivers/infiniband/core/device.c:720 enable_device_and_get+0x1cd/0x3b0 drivers/infiniband/core/device.c:1331 ib_register_device drivers/infiniband/core/device.c:1419 [inline] ib_register_device+0x854/0xb50 drivers/infiniband/core/device.c:1365 rxe_register_device+0x2fe/0x3b0 drivers/infiniband/sw/rxe/rxe_verbs.c:1146 rxe_add+0x1331/0x1710 drivers/infiniband/sw/rxe/rxe.c:248 rxe_net_add+0x8c/0xe0 drivers/infiniband/sw/rxe/rxe_net.c:543 rxe_newlink drivers/infiniband/sw/rxe/rxe.c:270 [inline] rxe_newlink+0xa9/0xd0 drivers/infiniband/sw/rxe/rxe.c:251 nldev_newlink+0x30a/0x560 drivers/infiniband/core/nldev.c:1717 rdma_nl_rcv_msg+0x36d/0x690 drivers/infiniband/core/netlink.c:195 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x2ee/0x430 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1341 netlink_sendmsg+0x86d/0xda0 net/netlink/af_netlink.c:1912 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492 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 Last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2985 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3065 mpls_dev_notify+0x562/0x890 net/mpls/af_mpls.c:1623 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 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] unregister_netdevice_many+0x964/0x1850 net/core/dev.c:10396 ip_tunnel_delete_nets+0x39f/0x5b0 net/ipv4/ip_tunnel.c:1123 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:593 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Second to last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3550 dropmon_net_event+0x226/0x480 net/core/drop_monitor.c:1578 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 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] unregister_netdevice_many+0x964/0x1850 net/core/dev.c:10396 ip_tunnel_delete_nets+0x39f/0x5b0 net/ipv4/ip_tunnel.c:1123 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:593 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88807a6dda80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 16 bytes inside of 64-byte region [ffff88807a6dda80, ffff88807a6ddac0) The buggy address belongs to the page: page:ffffea0001e9b740 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a6dd flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000001 ffff888010c41640 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 8185, ts 315448131967, free_ts 315448062460 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x32d/0x4a0 mm/slub.c:1993 ___slab_alloc+0x918/0xfe0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] kmem_cache_alloc_node_trace+0x116/0x310 mm/slub.c:3284 kmalloc_node include/linux/slab.h:608 [inline] kzalloc_node include/linux/slab.h:735 [inline] __get_vm_area_node.constprop.0+0xd3/0x380 mm/vmalloc.c:2427 __vmalloc_node_range+0x12f/0xab0 mm/vmalloc.c:3055 __vmalloc_node mm/vmalloc.c:3114 [inline] vzalloc+0x67/0x80 mm/vmalloc.c:3184 do_ip6t_get_ctl+0x60f/0xa10 net/ipv6/netfilter/ip6_tables.c:817 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1be/0x270 net/ipv6/ipv6_sockglue.c:1495 tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:4285 __sys_getsockopt+0x21f/0x5f0 net/socket.c:2220 __do_sys_getsockopt net/socket.c:2235 [inline] __se_sys_getsockopt net/socket.c:2232 [inline] __x64_sys_getsockopt+0xba/0x150 net/socket.c:2232 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 __vunmap+0x781/0xb70 mm/vmalloc.c:2632 __vfree+0x3c/0xd0 mm/vmalloc.c:2680 vfree+0x5a/0x90 mm/vmalloc.c:2711 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:884 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0x82f/0xa10 net/ipv6/netfilter/ip6_tables.c:1672 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1be/0x270 net/ipv6/ipv6_sockglue.c:1495 tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:4285 __sys_getsockopt+0x21f/0x5f0 net/socket.c:2220 __do_sys_getsockopt net/socket.c:2235 [inline] __se_sys_getsockopt net/socket.c:2232 [inline] __x64_sys_getsockopt+0xba/0x150 net/socket.c:2232 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 Memory state around the buggy address: ffff88807a6dd980: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff88807a6dda00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88807a6dda80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88807a6ddb00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88807a6ddb80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================