Free swap = 0kB Total swap = 0kB 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 ffff88806ad69110 by task syz-executor.1/15645 CPU: 0 PID: 15645 Comm: syz-executor.1 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+0xb7/0xe0 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:0x7fa3982fbae9 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:00007fa395850188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fa39840f020 RCX: 00007fa3982fbae9 RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000003 RBP: 00007fa398355f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdd1abe81f R14: 00007fa395850300 R15: 0000000000022000 Allocated by task 15645: 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+0xb7/0xe0 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 15645: 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+0xb7/0xe0 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 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:10414 sit_exit_batch_net+0x530/0x750 net/ipv6/sit.c:1951 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 setup_net+0x639/0xa30 net/core/net_namespace.c:349 copy_net_ns+0x318/0x760 net/core/net_namespace.c:470 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:3075 __do_sys_unshare kernel/fork.c:3146 [inline] __se_sys_unshare kernel/fork.c:3144 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3144 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 The buggy address belongs to the object at ffff88806ad69100 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 16 bytes inside of 64-byte region [ffff88806ad69100, ffff88806ad69140) The buggy address belongs to the page: page:ffffea0001ab5a40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6ad69 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001f577c0 dead000000000002 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 0x12c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY), pid 6516, ts 159812663998, free_ts 159810305876 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] slab_alloc mm/slub.c:3242 [inline] __kmalloc+0x2fb/0x340 mm/slub.c:4419 kmalloc include/linux/slab.h:595 [inline] kzalloc include/linux/slab.h:724 [inline] tomoyo_get_name+0x234/0x480 security/tomoyo/memory.c:173 tomoyo_parse_name_union+0xbc/0x160 security/tomoyo/util.c:260 tomoyo_update_path_number_acl security/tomoyo/file.c:687 [inline] tomoyo_write_file+0x629/0x7f0 security/tomoyo/file.c:1034 tomoyo_write_domain2+0x116/0x1d0 security/tomoyo/common.c:1152 tomoyo_add_entry security/tomoyo/common.c:2042 [inline] tomoyo_supervisor+0xbc7/0xf00 security/tomoyo/common.c:2103 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x419/0x590 security/tomoyo/file.c:734 security_file_ioctl+0x50/0xb0 security/security.c:1541 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0xb3/0x200 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 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 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3234 [inline] kmem_cache_alloc_node+0x255/0x3f0 mm/slub.c:3270 __alloc_skb+0x215/0x340 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1129 [inline] nlmsg_new include/net/netlink.h:953 [inline] netlink_ack+0x1f0/0xa60 net/netlink/af_netlink.c:2422 netlink_rcv_skb+0x33d/0x420 net/netlink/af_netlink.c:2493 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_sendto+0x21c/0x320 net/socket.c:2036 __do_sys_sendto net/socket.c:2048 [inline] __se_sys_sendto net/socket.c:2044 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2044 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: ffff88806ad69000: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88806ad69080: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff88806ad69100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88806ad69180: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88806ad69200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================