cgroup: Unknown subsys name 'net' cgroup: Unknown subsys name 'net_prio' cgroup: Unknown subsys name 'devices' cgroup: Unknown subsys name 'blkio' ========================= WARNING: held lock freed! 5.16.0-rc3-next-20211203 #1 Not tainted ------------------------- kworker/1:2/82 is freeing memory ffff88800e383000-ffff88800e3831ff, with a lock still held there! ffff88800e383148 (&root->kernfs_rwsem){++++}-{3:3}, at: kernfs_drain fs/kernfs/dir.c:486 [inline] ffff88800e383148 (&root->kernfs_rwsem){++++}-{3:3}, at: __kernfs_remove+0x627/0xb00 fs/kernfs/dir.c:1361 3 locks held by kworker/1:2/82: #0: ffff8880080a6138 ((wq_completion)cgroup_destroy){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff8880080a6138 ((wq_completion)cgroup_destroy){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff8880080a6138 ((wq_completion)cgroup_destroy){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1198 [inline] #0: ffff8880080a6138 ((wq_completion)cgroup_destroy){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:635 [inline] #0: ffff8880080a6138 ((wq_completion)cgroup_destroy){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline] #0: ffff8880080a6138 ((wq_completion)cgroup_destroy){+.+.}-{0:0}, at: process_one_work+0x929/0x1710 kernel/workqueue.c:2289 #1: ffff88800f907da8 ((work_completion)(&(&css->destroy_rwork)->work)){+.+.}-{0:0}, at: process_one_work+0x95d/0x1710 kernel/workqueue.c:2293 #2: ffff88800e383148 (&root->kernfs_rwsem){++++}-{3:3}, at: kernfs_drain fs/kernfs/dir.c:486 [inline] #2: ffff88800e383148 (&root->kernfs_rwsem){++++}-{3:3}, at: __kernfs_remove+0x627/0xb00 fs/kernfs/dir.c:1361 stack backtrace: CPU: 1 PID: 82 Comm: kworker/1:2 Not tainted 5.16.0-rc3-next-20211203 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: cgroup_destroy css_free_rwork_fn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106 print_freed_lock_bug kernel/locking/lockdep.c:6388 [inline] debug_check_no_locks_freed.cold+0xa5/0xb1 kernel/locking/lockdep.c:6421 slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook mm/slub.c:1754 [inline] slab_free mm/slub.c:3510 [inline] kfree+0xb3/0x5a0 mm/slub.c:4561 kernfs_put.part.0+0x334/0x540 fs/kernfs/dir.c:548 kernfs_put+0x42/0x50 fs/kernfs/dir.c:513 __kernfs_remove+0x7ce/0xb00 fs/kernfs/dir.c:1382 kernfs_remove fs/kernfs/dir.c:1397 [inline] kernfs_destroy_root+0x89/0xb0 fs/kernfs/dir.c:964 cgroup_destroy_root kernel/cgroup/cgroup.c:1374 [inline] css_free_rwork_fn+0xa28/0xf40 kernel/cgroup/cgroup.c:5112 process_one_work+0xa30/0x1710 kernel/workqueue.c:2318 worker_thread+0x62a/0x13e0 kernel/workqueue.c:2465 kthread+0x40c/0x500 kernel/kthread.c:345 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 ================================================================== BUG: KASAN: use-after-free in __up_write kernel/locking/rwsem.c:1318 [inline] BUG: KASAN: use-after-free in up_write+0x3ac/0x460 kernel/locking/rwsem.c:1576 Read of size 8 at addr ffff88800e383140 by task kworker/1:2/82 CPU: 1 PID: 82 Comm: kworker/1:2 Not tainted 5.16.0-rc3-next-20211203 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: cgroup_destroy css_free_rwork_fn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106 print_address_description.constprop.0+0x1f/0x180 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x7f/0x11b mm/kasan/report.c:459 __up_write kernel/locking/rwsem.c:1318 [inline] up_write+0x3ac/0x460 kernel/locking/rwsem.c:1576 cgroup_destroy_root kernel/cgroup/cgroup.c:1374 [inline] css_free_rwork_fn+0xa28/0xf40 kernel/cgroup/cgroup.c:5112 process_one_work+0xa30/0x1710 kernel/workqueue.c:2318 worker_thread+0x62a/0x13e0 kernel/workqueue.c:2465 kthread+0x40c/0x500 kernel/kthread.c:345 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 281: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc+0x81/0xa0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:715 [inline] kernfs_create_root+0x4c/0x410 fs/kernfs/dir.c:913 cgroup_setup_root+0x346/0xb60 kernel/cgroup/cgroup.c:2018 cgroup1_root_to_use kernel/cgroup/cgroup-v1.c:1194 [inline] cgroup1_get_tree+0xc1b/0x1370 kernel/cgroup/cgroup-v1.c:1211 vfs_get_tree+0x8e/0x2f0 fs/super.c:1500 do_new_mount fs/namespace.c:3004 [inline] path_mount+0x131b/0x1f80 fs/namespace.c:3334 do_mount fs/namespace.c:3347 [inline] __do_sys_mount fs/namespace.c:3555 [inline] __se_sys_mount fs/namespace.c:3532 [inline] __x64_sys_mount+0x27e/0x300 fs/namespace.c:3532 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 82: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 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+0x108/0x170 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook mm/slub.c:1754 [inline] slab_free mm/slub.c:3510 [inline] kfree+0xc5/0x5a0 mm/slub.c:4561 kernfs_put.part.0+0x334/0x540 fs/kernfs/dir.c:548 kernfs_put+0x42/0x50 fs/kernfs/dir.c:513 __kernfs_remove+0x7ce/0xb00 fs/kernfs/dir.c:1382 kernfs_remove fs/kernfs/dir.c:1397 [inline] kernfs_destroy_root+0x89/0xb0 fs/kernfs/dir.c:964 cgroup_destroy_root kernel/cgroup/cgroup.c:1374 [inline] css_free_rwork_fn+0xa28/0xf40 kernel/cgroup/cgroup.c:5112 process_one_work+0xa30/0x1710 kernel/workqueue.c:2318 worker_thread+0x62a/0x13e0 kernel/workqueue.c:2465 kthread+0x40c/0x500 kernel/kthread.c:345 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88800e383000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 320 bytes inside of 512-byte region [ffff88800e383000, ffff88800e383200) The buggy address belongs to the page: page:00000000cca33047 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xe380 head:00000000cca33047 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x100000000010200(slab|head|node=0|zone=1) raw: 0100000000010200 0000000000000000 dead000000000122 ffff888007841c80 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88800e383000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800e383080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88800e383100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88800e383180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800e383200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== cgroup: Unknown subsys name 'hugetlb' cgroup: Unknown subsys name 'rlimit'