================================================================== BUG: KASAN: use-after-free in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:670 Read of size 8 at addr ffff88804a17d068 by task kworker/u4:5/1031 CPU: 1 PID: 1031 Comm: kworker/u4:5 Not tainted 5.17.0-rc8-syzkaller-00045-g551acdc3c3d2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net 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:670 sk_error_report+0x35/0x310 net/core/sock.c:340 tcp_write_err net/ipv4/tcp_timer.c:71 [inline] tcp_probe_timer net/ipv4/tcp_timer.c:395 [inline] tcp_write_timer_handler+0x437/0xbc0 net/ipv4/tcp_timer.c:626 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:642 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:radix_tree_descend lib/radix-tree.c:87 [inline] RIP: 0010:__radix_tree_lookup+0x16b/0x2a0 lib/radix-tree.c:764 Code: fd 3f 0f 87 d1 f8 14 05 e8 62 1a 75 fd 4d 89 f7 44 89 e9 49 d3 ef 41 83 e7 3f 4a 8d 7c fb 28 48 89 f8 48 c1 e8 03 80 3c 28 00 <0f> 85 e4 00 00 00 49 8d 47 04 4c 8b 64 c3 08 4e 8d 7c fb 28 49 81 RSP: 0018:ffffc90004ab7788 EFLAGS: 00000246 RAX: 1ffff1100e3e8771 RBX: ffff888071f439c0 RCX: 0000000000000000 RDX: ffff88801bd3d700 RSI: ffffffff8403a5ce RDI: ffff888071f43b88 RBP: dffffc0000000000 R08: 0000000000000002 R09: 0000000000000000 R10: ffffffff8403a5bf R11: 000000000000003f R12: 1ffff1100e3e8738 R13: 0000000000000000 R14: 00000000001aedf4 R15: 0000000000000034 radix_tree_delete_item+0x9f/0x230 lib/radix-tree.c:1419 kernfs_put.part.0+0x294/0x540 fs/kernfs/dir.c:537 kernfs_put+0x42/0x50 fs/kernfs/dir.c:513 __kernfs_remove+0x7a3/0xb20 fs/kernfs/dir.c:1388 kernfs_remove_by_name_ns+0xa8/0x110 fs/kernfs/dir.c:1565 kernfs_remove_by_name include/linux/kernfs.h:574 [inline] remove_files+0x96/0x1c0 fs/sysfs/group.c:28 sysfs_remove_group+0x87/0x170 fs/sysfs/group.c:288 sysfs_remove_groups fs/sysfs/group.c:312 [inline] sysfs_remove_groups+0x5c/0xa0 fs/sysfs/group.c:304 destroy_port drivers/infiniband/core/sysfs.c:1285 [inline] ib_free_port_attrs+0x162/0x460 drivers/infiniband/core/sysfs.c:1410 remove_one_compat_dev drivers/infiniband/core/device.c:1001 [inline] rdma_dev_exit_net+0x2b2/0x550 drivers/infiniband/core/device.c:1139 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:168 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:597 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 The buggy address belongs to the page: page:ffffea0001285f40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4a17d flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001e4b708 ffffea0001fa4488 0000000000000000 raw: 0000000000000000 0000000000110000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 27677, ts 755084329843, free_ts 776409990668 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+0x27f/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0xbe1/0x12b0 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+0x3cb/0x4b0 mm/slub.c:3243 kmem_cache_zalloc include/linux/slab.h:704 [inline] __kernfs_new_node+0xd4/0x8b0 fs/kernfs/dir.c:585 kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:647 __kernfs_create_file+0x51/0x350 fs/kernfs/file.c:987 sysfs_add_file_mode_ns+0x20f/0x3f0 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x322/0xb10 fs/sysfs/group.c:148 internal_create_groups.part.0+0x90/0x140 fs/sysfs/group.c:188 internal_create_groups fs/sysfs/group.c:184 [inline] sysfs_create_groups+0x25/0x50 fs/sysfs/group.c:214 setup_gid_attrs drivers/infiniband/core/sysfs.c:1169 [inline] ib_setup_port_attrs+0x3e7/0x5c0 drivers/infiniband/core/sysfs.c:1441 add_one_compat_dev drivers/infiniband/core/device.c:968 [inline] add_one_compat_dev+0x517/0x7f0 drivers/infiniband/core/device.c:919 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 __unfreeze_partials+0x320/0x340 mm/slub.c:2536 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+0x271/0x4b0 mm/slub.c:3243 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags include/linux/audit.h:323 [inline] getname fs/namei.c:217 [inline] __do_sys_unlink fs/namei.c:4266 [inline] __se_sys_unlink fs/namei.c:4264 [inline] __x64_sys_unlink+0xb1/0x110 fs/namei.c:4264 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: ffff88804a17cf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804a17cf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88804a17d000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804a17d080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804a17d100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 0f 87 d1 f8 14 05 ja 0x514f8d7 6: e8 62 1a 75 fd callq 0xfd751a6d b: 4d 89 f7 mov %r14,%r15 e: 44 89 e9 mov %r13d,%ecx 11: 49 d3 ef shr %cl,%r15 14: 41 83 e7 3f and $0x3f,%r15d 18: 4a 8d 7c fb 28 lea 0x28(%rbx,%r15,8),%rdi 1d: 48 89 f8 mov %rdi,%rax 20: 48 c1 e8 03 shr $0x3,%rax 24: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1) * 28: 0f 85 e4 00 00 00 jne 0x112 <-- trapping instruction 2e: 49 8d 47 04 lea 0x4(%r15),%rax 32: 4c 8b 64 c3 08 mov 0x8(%rbx,%rax,8),%r12 37: 4e 8d 7c fb 28 lea 0x28(%rbx,%r15,8),%r15 3c: 49 rex.WB 3d: 81 .byte 0x81