smc: removing ib device rxe0 smbdirect: ib_dev[rxe0] removed ================================================================== BUG: KASAN: slab-use-after-free in kobject_uevent_net_broadcast+0x12c/0x560 lib/kobject_uevent.c:415 Read of size 8 at addr ffff888013eb3c50 by task syz.0.0/5357 CPU: 0 UID: 0 PID: 5357 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 kobject_uevent_net_broadcast+0x12c/0x560 lib/kobject_uevent.c:415 kobject_uevent_env+0x566/0x9e0 lib/kobject_uevent.c:611 device_del+0x74d/0x8f0 drivers/base/core.c:3985 remove_one_compat_dev drivers/infiniband/core/device.c:1036 [inline] remove_compat_devs drivers/infiniband/core/device.c:1047 [inline] disable_device+0x248/0x330 drivers/infiniband/core/device.c:1339 __ib_unregister_device+0x2c9/0x400 drivers/infiniband/core/device.c:1571 ib_unregister_device_and_put+0xb8/0xf0 drivers/infiniband/core/device.c:1636 nldev_dellink+0x3a4/0x440 drivers/infiniband/core/nldev.c:1905 rdma_nl_rcv_msg drivers/infiniband/core/netlink.c:-1 [inline] rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0x6ef/0xa40 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1336 [inline] netlink_unicast+0x8ef/0xa80 net/netlink/af_netlink.c:1362 netlink_sendmsg+0x7f0/0xb20 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec+0x14e/0x190 net/socket.c:800 __sock_sendmsg net/socket.c:818 [inline] ____sys_sendmsg+0x49f/0x790 net/socket.c:2713 ___sys_sendmsg+0x2f8/0x3d0 net/socket.c:2770 __sys_sendmsg net/socket.c:2802 [inline] __do_sys_sendmsg net/socket.c:2807 [inline] __se_sys_sendmsg net/socket.c:2805 [inline] __x64_sys_sendmsg+0x1b1/0x290 net/socket.c:2805 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f42999a94d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f429a8b3fe8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f4299c26090 RCX: 00007f42999a94d9 RDX: 0000000000000000 RSI: 0000200000000580 RDI: 0000000000000003 RBP: 00007f4299a3804e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4299c26128 R14: 00007f4299c26090 R15: 00007fffec362678 Allocated by task 5356: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:409 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x31c/0x600 mm/slub.c:5680 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] uevent_net_init+0xdb/0x2d0 lib/kobject_uevent.c:782 ops_init+0x35d/0x5d0 net/core/net_namespace.c:137 setup_net+0x112/0x350 net/core/net_namespace.c:448 copy_net_ns+0x540/0x780 net/core/net_namespace.c:589 create_new_namespaces+0x3f0/0x6b0 kernel/nsproxy.c:132 unshare_nsproxy_namespaces+0x144/0x190 kernel/nsproxy.c:234 ksys_unshare+0x532/0x890 kernel/fork.c:3306 __do_sys_unshare kernel/fork.c:3372 [inline] __se_sys_unshare kernel/fork.c:3370 [inline] __x64_sys_unshare+0x38/0x50 kernel/fork.c:3370 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 78: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:264 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:296 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2780 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x1c5/0x650 mm/slub.c:6923 ops_exit_list net/core/net_namespace.c:200 [inline] ops_undo_list+0x451/0x8f0 net/core/net_namespace.c:253 cleanup_net+0x578/0x810 net/core/net_namespace.c:713 process_one_work kernel/workqueue.c:3495 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888013eb3c40 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 16 bytes inside of freed 32-byte region [ffff888013eb3c40, ffff888013eb3c60) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13eb3 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801c841780 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000400040 00000000f5000000 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5355, tgid 5355 (syz.0.0), ts 86441174714 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1860 prep_new_page mm/page_alloc.c:1868 [inline] get_page_from_freelist+0x225d/0x22e0 mm/page_alloc.c:3950 __alloc_frozen_pages_noprof+0x211/0x450 mm/page_alloc.c:5492 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab+0x7d/0x5e0 mm/slub.c:3499 new_slab mm/slub.c:3550 [inline] ___slab_alloc+0x16a/0x960 mm/slub.c:4605 slab_alloc_node mm/slub.c:5024 [inline] __do_kmalloc_node mm/slub.c:5530 [inline] __kmalloc_flags_noprof+0x33c/0x790 mm/slub.c:5719 _kmalloc_flags_noprof mm/slab.h:55 [inline] alloc_slab_obj_exts+0x5c/0x180 mm/slub.c:2218 __memcg_slab_post_alloc_hook+0x5f0/0xdb0 mm/memcontrol.c:3713 memcg_slab_post_alloc_hook mm/slub.c:2549 [inline] slab_post_alloc_hook mm/slub.c:4739 [inline] slab_alloc_node mm/slub.c:5033 [inline] kmem_cache_alloc_node_noprof+0x401/0x600 mm/slub.c:5105 alloc_task_struct_node kernel/fork.c:188 [inline] dup_task_struct+0x52/0xa00 kernel/fork.c:923 copy_process+0x7ea/0x4510 kernel/fork.c:2150 kernel_clone+0x2d7/0x940 kernel/fork.c:2798 __do_sys_clone3 kernel/fork.c:3101 [inline] __se_sys_clone3+0x33c/0x360 kernel/fork.c:3080 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 1380 tgid 1380 ts 85890399886 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0xd1a/0xe10 mm/page_alloc.c:2958 __slab_free+0x269/0x2c0 mm/slub.c:5926 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:361 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4720 [inline] slab_alloc_node mm/slub.c:5033 [inline] kmem_cache_alloc_node_noprof+0x34f/0x600 mm/slub.c:5105 __alloc_skb+0x1db/0x7a0 net/core/skbuff.c:705 alloc_skb include/linux/skbuff.h:1390 [inline] mld_newpack+0x165/0xcb0 net/ipv6/mcast.c:1810 add_grhead net/ipv6/mcast.c:1921 [inline] add_grec+0x119f/0x19d0 net/ipv6/mcast.c:2060 mld_send_cr net/ipv6/mcast.c:2185 [inline] mld_ifc_work+0x6f1/0xd60 net/ipv6/mcast.c:2739 process_one_work kernel/workqueue.c:3495 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888013eb3b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff888013eb3b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff888013eb3c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff888013eb3c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff888013eb3d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ==================================================================