oom_control is deprecated and will be removed. Please report your usecase to linux-mm@kvack.org if you depend on this functionality. block2mtd: error: cannot open device /dev/loop0 ================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x31/0x190 lib/list_debug.c:49 Read of size 8 at addr ffff888044cf3058 by task syz.0.0/5322 CPU: 0 UID: 0 PID: 5322 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 __list_del_entry_valid_or_report+0x31/0x190 lib/list_debug.c:49 __list_del_entry_valid include/linux/list.h:140 [inline] __list_del_entry include/linux/list.h:261 [inline] list_del include/linux/list.h:275 [inline] uvcg_extension_drop+0x81/0x1f0 drivers/usb/gadget/function/uvc_configfs.c:1260 configfs_mkdir+0x7e9/0x9e0 fs/configfs/dir.c:1452 vfs_mkdir+0x40c/0x620 fs/namei.c:5439 filename_mkdirat+0x285/0x510 fs/namei.c:5472 __do_sys_mkdirat fs/namei.c:5493 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5490 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9164d9e1d9 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:00007f9165bc7fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f9165025fa0 RCX: 00007f9164d9e1d9 RDX: 00000000000001c0 RSI: 0000200000000400 RDI: ffffffffffffff9c RBP: 00007f9164e35888 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f9165026038 R14: 00007f9165025fa0 R15: 00007ffcaf9e5638 Allocated by task 5322: 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+0x321/0x600 mm/slub.c:5563 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] uvcg_extension_make+0x95/0x300 drivers/usb/gadget/function/uvc_configfs.c:1276 configfs_mkdir+0x580/0x9e0 fs/configfs/dir.c:1378 vfs_mkdir+0x40c/0x620 fs/namei.c:5439 filename_mkdirat+0x285/0x510 fs/namei.c:5472 __do_sys_mkdirat fs/namei.c:5493 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5490 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5322: 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:2748 [inline] slab_free mm/slub.c:6509 [inline] kfree+0x1c5/0x650 mm/slub.c:6802 config_item_cleanup fs/configfs/item.c:128 [inline] config_item_release+0x13a/0x2d0 fs/configfs/item.c:137 uvcg_extension_drop+0x75/0x1f0 drivers/usb/gadget/function/uvc_configfs.c:1259 configfs_mkdir+0x7e9/0x9e0 fs/configfs/dir.c:1452 vfs_mkdir+0x40c/0x620 fs/namei.c:5439 filename_mkdirat+0x285/0x510 fs/namei.c:5472 __do_sys_mkdirat fs/namei.c:5493 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5490 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888044cf3000 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 88 bytes inside of freed 192-byte region [ffff888044cf3000, ffff888044cf30c0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888044cf3a00 pfn:0x44cf3 flags: 0x4fff00000000200(workingset|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000200 ffff88801c0413c0 ffff888030400288 ffff888030400288 raw: ffff888044cf3a00 000000000010000a 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5322, tgid 5321 (syz.0.0), ts 86212935744 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x2209/0x2280 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x217/0x5a0 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab+0x7d/0x620 mm/slub.c:3462 new_slab mm/slub.c:3513 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7418 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __kmalloc_cache_noprof+0x39b/0x600 mm/slub.c:5559 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] cgroup_file_open+0x8d/0x3a0 kernel/cgroup/cgroup.c:4357 kernfs_fop_open+0xa1e/0xce0 fs/kernfs/file.c:717 do_dentry_open+0x816/0x1380 fs/open.c:996 vfs_open+0x3b/0x340 fs/open.c:1101 do_open fs/namei.c:4866 [inline] path_openat+0x1443/0x1d60 fs/namei.c:5029 do_file_open+0x23e/0x4a0 fs/namei.c:5058 do_sys_openat2+0x115/0x200 fs/open.c:1417 do_sys_open fs/open.c:1423 [inline] __do_sys_openat fs/open.c:1439 [inline] __se_sys_openat fs/open.c:1434 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1434 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 page last free pid 5322 tgid 5321 ts 86201564702 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0xc93/0xd90 mm/page_alloc.c:2962 __tlb_remove_table_free mm/mmu_gather.c:228 [inline] tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:291 rcu_do_batch kernel/rcu/tree.c:2650 [inline] rcu_core+0x926/0x1260 kernel/rcu/tree.c:2919 handle_softirqs+0x226/0x860 kernel/softirq.c:645 do_softirq+0x77/0xd0 kernel/softirq.c:546 __local_bh_enable_ip+0x100/0x140 kernel/softirq.c:473 spin_unlock_bh include/linux/spinlock.h:407 [inline] cgroup_idr_replace kernel/cgroup/cgroup.c:377 [inline] css_create kernel/cgroup/cgroup.c:5947 [inline] cgroup_apply_control_enable+0x9e5/0xda0 kernel/cgroup/cgroup.c:3460 cgroup_mkdir+0xd2c/0xf90 kernel/cgroup/cgroup.c:6150 kernfs_iop_mkdir+0x213/0x360 fs/kernfs/dir.c:1305 vfs_mkdir+0x40c/0x620 fs/namei.c:5439 filename_mkdirat+0x285/0x510 fs/namei.c:5472 __do_sys_mkdirat fs/namei.c:5493 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5490 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888044cf2f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888044cf2f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888044cf3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888044cf3080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888044cf3100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================