Node 1 hugepages_total=2 hugepages_free=2 hugepages_surp=0 hugepages_size=2048kB 52495 total pagecache pages 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB 2097051 pages RAM 0 pages HighMem/MovableOnly 387046 pages reserved 0 pages cma reserved ================================================================== BUG: KASAN: use-after-free in rxe_queue_cleanup+0x34/0xf0 drivers/infiniband/sw/rxe/rxe_queue.c:193 Read of size 8 at addr ffff88808e858e90 by task syz-executor.5/13241 CPU: 1 PID: 13241 Comm: syz-executor.5 Not tainted 5.16.0-rc2-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+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x65/0x380 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:450 rxe_queue_cleanup+0x34/0xf0 drivers/infiniband/sw/rxe/rxe_queue.c:193 rxe_qp_do_cleanup+0x60/0x8d0 drivers/infiniband/sw/rxe/rxe_qp.c:804 execute_in_process_context+0x116/0x120 kernel/workqueue.c:3359 rxe_elem_release+0x9c/0x180 drivers/infiniband/sw/rxe/rxe_pool.c:407 kref_put include/linux/kref.h:65 [inline] rxe_create_qp+0x296/0x310 drivers/infiniband/sw/rxe/rxe_verbs.c:450 create_qp+0x556/0x760 drivers/infiniband/core/verbs.c:1241 ib_create_qp_kernel+0xb7/0x350 drivers/infiniband/core/verbs.c:1352 ib_create_qp include/rdma/ib_verbs.h:3722 [inline] create_mad_qp drivers/infiniband/core/mad.c:2910 [inline] ib_mad_port_open drivers/infiniband/core/mad.c:2991 [inline] ib_mad_init_device+0xf38/0x2ed0 drivers/infiniband/core/mad.c:3082 add_client_context+0x4f6/0x830 drivers/infiniband/core/device.c:720 enable_device_and_get+0x1eb/0x480 drivers/infiniband/core/device.c:1331 ib_register_device+0x1178/0x1540 drivers/infiniband/core/device.c:1419 rxe_register_device+0x25d/0x360 drivers/infiniband/sw/rxe/rxe_verbs.c:1146 rxe_net_add+0x73/0xd0 drivers/infiniband/sw/rxe/rxe_net.c:543 rxe_newlink+0x65/0x100 drivers/infiniband/sw/rxe/rxe.c:270 nldev_newlink+0x5b4/0x660 drivers/infiniband/core/nldev.c:1717 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x6f1/0xa30 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x814/0x9f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0xa20/0xe40 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x5b9/0x910 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmsg+0x280/0x370 net/socket.c:2492 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f1731094ae9 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:00007f172e60a188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f17311a7f60 RCX: 00007f1731094ae9 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000006 RBP: 00007f17310eef6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffede02d3df R14: 00007f172e60a300 R15: 0000000000022000 Allocated by task 13241: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:269 [inline] kmem_cache_alloc_trace+0x9d/0x330 mm/slub.c:3261 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] rxe_queue_init+0x90/0x540 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/0x12b0 drivers/infiniband/sw/rxe/rxe_qp.c:347 rxe_create_qp+0x235/0x310 drivers/infiniband/sw/rxe/rxe_verbs.c:442 create_qp+0x556/0x760 drivers/infiniband/core/verbs.c:1241 ib_create_qp_kernel+0xb7/0x350 drivers/infiniband/core/verbs.c:1352 ib_create_qp include/rdma/ib_verbs.h:3722 [inline] create_mad_qp drivers/infiniband/core/mad.c:2910 [inline] ib_mad_port_open drivers/infiniband/core/mad.c:2991 [inline] ib_mad_init_device+0xf38/0x2ed0 drivers/infiniband/core/mad.c:3082 add_client_context+0x4f6/0x830 drivers/infiniband/core/device.c:720 enable_device_and_get+0x1eb/0x480 drivers/infiniband/core/device.c:1331 ib_register_device+0x1178/0x1540 drivers/infiniband/core/device.c:1419 rxe_register_device+0x25d/0x360 drivers/infiniband/sw/rxe/rxe_verbs.c:1146 rxe_net_add+0x73/0xd0 drivers/infiniband/sw/rxe/rxe_net.c:543 rxe_newlink+0x65/0x100 drivers/infiniband/sw/rxe/rxe.c:270 nldev_newlink+0x5b4/0x660 drivers/infiniband/core/nldev.c:1717 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x6f1/0xa30 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x814/0x9f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0xa20/0xe40 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x5b9/0x910 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmsg+0x280/0x370 net/socket.c:2492 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 13241: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x10d/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kfree+0xe1/0x330 mm/slub.c:4561 rxe_qp_from_init+0xc50/0x12b0 drivers/infiniband/sw/rxe/rxe_qp.c:361 rxe_create_qp+0x235/0x310 drivers/infiniband/sw/rxe/rxe_verbs.c:442 create_qp+0x556/0x760 drivers/infiniband/core/verbs.c:1241 ib_create_qp_kernel+0xb7/0x350 drivers/infiniband/core/verbs.c:1352 ib_create_qp include/rdma/ib_verbs.h:3722 [inline] create_mad_qp drivers/infiniband/core/mad.c:2910 [inline] ib_mad_port_open drivers/infiniband/core/mad.c:2991 [inline] ib_mad_init_device+0xf38/0x2ed0 drivers/infiniband/core/mad.c:3082 add_client_context+0x4f6/0x830 drivers/infiniband/core/device.c:720 enable_device_and_get+0x1eb/0x480 drivers/infiniband/core/device.c:1331 ib_register_device+0x1178/0x1540 drivers/infiniband/core/device.c:1419 rxe_register_device+0x25d/0x360 drivers/infiniband/sw/rxe/rxe_verbs.c:1146 rxe_net_add+0x73/0xd0 drivers/infiniband/sw/rxe/rxe_net.c:543 rxe_newlink+0x65/0x100 drivers/infiniband/sw/rxe/rxe.c:270 nldev_newlink+0x5b4/0x660 drivers/infiniband/core/nldev.c:1717 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x6f1/0xa30 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x814/0x9f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0xa20/0xe40 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x5b9/0x910 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmsg+0x280/0x370 net/socket.c:2492 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88808e858e80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 16 bytes inside of 64-byte region [ffff88808e858e80, ffff88808e858ec0) The buggy address belongs to the page: page:ffffea00023a1600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8e858 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000732840 dead000000000008 ffff888011441640 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 13038, ts 285292377779, free_ts 284225470741 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4149 __alloc_pages+0x255/0x580 mm/page_alloc.c:5369 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab+0xcc/0x4d0 mm/slub.c:1930 new_slab mm/slub.c:1993 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:3022 __slab_alloc mm/slub.c:3109 [inline] slab_alloc_node mm/slub.c:3200 [inline] __kmalloc_node+0x2ec/0x420 mm/slub.c:4467 kmalloc_node include/linux/slab.h:613 [inline] kvmalloc_node+0x81/0x110 mm/util.c:587 init_free_nid_cache fs/f2fs/node.c:3263 [inline] f2fs_build_node_manager+0xa51/0x1640 fs/f2fs/node.c:3296 f2fs_fill_super+0x7703/0xa970 fs/f2fs/super.c:4176 mount_bdev+0x26c/0x3a0 fs/super.c:1370 legacy_get_tree+0xea/0x180 fs/fs_context.c:610 vfs_get_tree+0x86/0x270 fs/super.c:1500 do_new_mount fs/namespace.c:2988 [inline] path_mount+0x1986/0x2c30 fs/namespace.c:3318 do_mount fs/namespace.c:3331 [inline] __do_sys_mount fs/namespace.c:3539 [inline] __se_sys_mount+0x308/0x3c0 fs/namespace.c:3516 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae 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+0xd1c/0xe00 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page_list+0x11f/0xa50 mm/page_alloc.c:3425 release_pages+0x15a7/0x17d0 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu+0x780/0x910 mm/mmu_gather.c:249 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:340 exit_mmap+0x3dd/0x6f0 mm/mmap.c:3172 __mmput+0x111/0x3a0 kernel/fork.c:1113 exit_mm+0x211/0x2f0 kernel/exit.c:507 do_exit+0x688/0x24f0 kernel/exit.c:819 do_group_exit+0x168/0x2d0 kernel/exit.c:929 get_signal+0x1740/0x2120 kernel/signal.c:2852 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88808e858d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808e858e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808e858e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88808e858f00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88808e858f80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ==================================================================