loop7: detected capacity change from 0 to 4097 cgroup2: Unknown parameter 'blkio' 9p: Unknown Cache mode n SELinux: security_context_str_to_sid (root) failed with errno=-22 ================================================================== BUG: KASAN: use-after-free in __kernfs_remove+0x9dd/0xb30 Read of size 2 at addr ffff888044a71b78 by task syz-executor.1/5038 CPU: 1 PID: 5038 Comm: syz-executor.1 Not tainted 6.0.0-rc3-next-20220829 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 print_report.cold+0x5e/0x5e5 kasan_report+0xb1/0x1c0 __kernfs_remove+0x9dd/0xb30 kernfs_remove_by_name_ns+0xa8/0x110 sysfs_slab_add+0x142/0x1f0 __kmem_cache_create+0x49d/0x600 kmem_cache_create_usercopy+0x1fd/0x2e0 p9_client_create+0xc85/0x1050 v9fs_session_init+0x1dd/0x1670 v9fs_mount+0xb9/0xbd0 legacy_get_tree+0x105/0x220 vfs_get_tree+0x8e/0x300 path_mount+0x1310/0x1e20 __x64_sys_mount+0x282/0x300 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4ae40a8b19 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:00007f4ae161e188 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f4ae41bbf60 RCX: 00007f4ae40a8b19 RDX: 00000000200025c0 RSI: 0000000020000240 RDI: 0000000000000000 RBP: 00007f4ae4102f6d R08: 0000000020000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd17bf93cf R14: 00007f4ae161e300 R15: 0000000000022000 Allocated by task 5039: kasan_save_stack+0x1e/0x40 __kasan_slab_alloc+0x66/0x80 kmem_cache_alloc+0x1b1/0x3e0 __kernfs_new_node+0xd4/0x8c0 kernfs_create_dir_ns+0x9c/0x230 sysfs_create_dir_ns+0x127/0x290 kobject_add_internal+0x24c/0x8e0 kobject_init_and_add+0x101/0x160 sysfs_slab_add+0x165/0x1f0 __kmem_cache_create+0x49d/0x600 kmem_cache_create_usercopy+0x1fd/0x2e0 p9_client_create+0xc85/0x1050 v9fs_session_init+0x1dd/0x1670 v9fs_mount+0xb9/0xbd0 legacy_get_tree+0x105/0x220 vfs_get_tree+0x8e/0x300 path_mount+0x1310/0x1e20 __x64_sys_mount+0x282/0x300 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5038: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x40 __kasan_slab_free+0x108/0x190 kmem_cache_free+0xf7/0x610 kernfs_put.part.0+0x2c7/0x540 kernfs_put+0x42/0x50 __kernfs_remove+0x7d4/0xb30 kernfs_remove_by_name_ns+0xa8/0x110 sysfs_slab_add+0x142/0x1f0 __kmem_cache_create+0x49d/0x600 kmem_cache_create_usercopy+0x1fd/0x2e0 p9_client_create+0xc85/0x1050 v9fs_session_init+0x1dd/0x1670 v9fs_mount+0xb9/0xbd0 legacy_get_tree+0x105/0x220 vfs_get_tree+0x8e/0x300 path_mount+0x1310/0x1e20 __x64_sys_mount+0x282/0x300 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888044a71ae0 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 152 bytes inside of 168-byte region [ffff888044a71ae0, ffff888044a71b88) The buggy address belongs to the physical page: page:00000000c762c616 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44a71 flags: 0x100000000000200(slab|node=0|zone=1) raw: 0100000000000200 0000000000000000 dead000000000122 ffff88800847b8c0 raw: 0000000000000000 0000000000110011 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888044a71a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888044a71a80: 00 00 00 00 fc fc fc fc fc fc fc fc fa fb fb fb >ffff888044a71b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888044a71b80: fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb ffff888044a71c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ================================================================== SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pid=5031 comm=syz-executor.7 syz-executor.2: attempt to access beyond end of device loop2: rw=2049, sector=40, nr_sectors = 4 limit=40 cgroup2: Unknown parameter 'blkio' SELinux: security_context_str_to_sid (root) failed with errno=-22 cgroup2: Unknown parameter 'blkio' SELinux: security_context_str_to_sid (root) failed with errno=-22 loop7: detected capacity change from 0 to 4097 loop2: detected capacity change from 0 to 40 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pid=5070 comm=syz-executor.7 syz-executor.2: attempt to access beyond end of device loop2: rw=2049, sector=40, nr_sectors = 4 limit=40 general protection fault, probably for non-canonical address 0x2bbebdc22011708: 0000 [#1] PREEMPT SMP KASAN NOPTI CPU: 1 PID: 5077 Comm: systemd-udevd Tainted: G B 6.0.0-rc3-next-20220829 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:qlist_free_all+0xaf/0x1a0 Code: 80 4c 01 c2 0f 82 f8 00 00 00 48 c7 c0 00 00 00 80 48 2b 05 f3 3c 9b 03 48 01 d0 48 c1 e8 0c 48 c1 e0 06 48 03 05 d1 3c 9b 03 <48> 8b 48 08 48 89 c2 f6 c1 01 0f 85 ba 00 00 00 0f 1f 44 00 00 48 RSP: 0018:ffff8880453b7c70 EFLAGS: 00010207 RAX: 02bbebdc22011700 RBX: aeffff888045c055 RCX: 0000000000070003 RDX: aeffff890045c055 RSI: ffffea0000240000 RDI: 0000000040000000 RBP: 0000000000000000 R08: aeffff888045c055 R09: 0000000000070003 R10: ffffea0000240000 R11: 0000000000000000 R12: dffffc0000000000 R13: ffff8880453b7cb0 R14: 0000000000000000 R15: ffff888009002201 FS: 00007fef0bc3a8c0(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000561ebb9560e0 CR3: 00000000175dc000 CR4: 0000000000350ee0 Call Trace: kasan_quarantine_reduce+0x184/0x210 __kasan_slab_alloc+0x7c/0x80 kmem_cache_alloc+0x1b1/0x3e0 getname_flags.part.0+0x50/0x4f0 getname+0x8e/0xd0 do_sys_openat2+0xf9/0x4c0 __x64_sys_openat+0x13f/0x1f0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fef0c0e9d62 Code: c0 f6 c2 40 75 52 89 d0 45 31 d2 25 00 00 41 00 3d 00 00 41 00 74 41 64 8b 04 25 18 00 00 00 85 c0 75 65 b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 a2 00 00 00 48 8b 4c 24 38 64 48 2b 0c 25 RSP: 002b:00007fff92a1e7a0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fef0c0e9d62 RDX: 00000000002a0000 RSI: 0000561ebb9800d1 RDI: 0000000000000010 RBP: 0000561ebb9800d0 R08: 0000561eba9878f0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000561ebb975684 R13: 0000000000000010 R14: 0000000000000004 R15: 0000561ebb9800d1 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:qlist_free_all+0xaf/0x1a0 Code: 80 4c 01 c2 0f 82 f8 00 00 00 48 c7 c0 00 00 00 80 48 2b 05 f3 3c 9b 03 48 01 d0 48 c1 e8 0c 48 c1 e0 06 48 03 05 d1 3c 9b 03 <48> 8b 48 08 48 89 c2 f6 c1 01 0f 85 ba 00 00 00 0f 1f 44 00 00 48 RSP: 0018:ffff8880453b7c70 EFLAGS: 00010207 RAX: 02bbebdc22011700 RBX: aeffff888045c055 RCX: 0000000000070003 RDX: aeffff890045c055 RSI: ffffea0000240000 RDI: 0000000040000000 RBP: 0000000000000000 R08: aeffff888045c055 R09: 0000000000070003 R10: ffffea0000240000 R11: 0000000000000000 R12: dffffc0000000000 R13: ffff8880453b7cb0 R14: 0000000000000000 R15: ffff888009002201 FS: 00007fef0bc3a8c0(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000561ebb9560e0 CR3: 00000000175dc000 CR4: 0000000000350ee0 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 4c 01 c2 add %r8,%rdx 3: 0f 82 f8 00 00 00 jb 0x101 9: 48 c7 c0 00 00 00 80 mov $0xffffffff80000000,%rax 10: 48 2b 05 f3 3c 9b 03 sub 0x39b3cf3(%rip),%rax # 0x39b3d0a 17: 48 01 d0 add %rdx,%rax 1a: 48 c1 e8 0c shr $0xc,%rax 1e: 48 c1 e0 06 shl $0x6,%rax 22: 48 03 05 d1 3c 9b 03 add 0x39b3cd1(%rip),%rax # 0x39b3cfa * 29: 48 8b 48 08 mov 0x8(%rax),%rcx <-- trapping instruction 2d: 48 89 c2 mov %rax,%rdx 30: f6 c1 01 test $0x1,%cl 33: 0f 85 ba 00 00 00 jne 0xf3 39: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 3e: 48 rex.W