================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in kernfs_get+0x21/0x90 fs/kernfs/dir.c:504 Read of size 4 at addr ffff88815c2ac708 by task kworker/1:7/31839 CPU: 1 PID: 31839 Comm: kworker/1:7 Not tainted 5.15.73-syzkaller-04348-g44b8b2ac1d96 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: events flush_stashed_error_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3d0 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x1a6/0x1f0 mm/kasan/report.c:452 kasan_check_range+0x2aa/0x2e0 mm/kasan/generic.c:189 __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] kernfs_get+0x21/0x90 fs/kernfs/dir.c:504 sysfs_notify+0x9a/0xd0 fs/sysfs/file.c:190 ext4_notify_error_sysfs+0x25/0x30 fs/ext4/sysfs.c:511 flush_stashed_error_work+0x305/0x320 process_one_work+0x6db/0xc00 kernel/workqueue.c:2313 worker_thread+0xb3e/0x1340 kernel/workqueue.c:2460 kthread+0x41c/0x500 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 Allocated by task 1302: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook mm/slab.h:550 [inline] slab_alloc_node mm/slub.c:3236 [inline] slab_alloc mm/slub.c:3244 [inline] kmem_cache_alloc+0x189/0x2f0 mm/slub.c:3249 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xdb/0x6e0 fs/kernfs/dir.c:593 kernfs_new_node fs/kernfs/dir.c:655 [inline] kernfs_create_dir_ns+0x9b/0x230 fs/kernfs/dir.c:991 sysfs_create_dir_ns+0x181/0x390 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x766/0xda0 lib/kobject.c:255 kobject_add_varg lib/kobject.c:390 [inline] kobject_init_and_add+0x123/0x190 lib/kobject.c:473 ext4_register_sysfs+0xc0/0x2c0 fs/ext4/sysfs.c:524 ext4_fill_super+0x8983/0x9650 fs/ext4/super.c:4941 mount_bdev+0x280/0x3b0 fs/super.c:1368 ext4_mount+0x34/0x40 fs/ext4/super.c:6545 legacy_get_tree+0xf0/0x190 fs/fs_context.c:610 vfs_get_tree+0x88/0x290 fs/super.c:1498 do_new_mount+0x289/0xad0 fs/namespace.c:2994 path_mount+0x60b/0x1050 fs/namespace.c:3324 do_mount fs/namespace.c:3337 [inline] __do_sys_mount fs/namespace.c:3545 [inline] __se_sys_mount+0x2d2/0x3c0 fs/namespace.c:3522 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3522 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 496: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1721 [inline] slab_free_freelist_hook+0xc9/0x1a0 mm/slub.c:1747 slab_free mm/slub.c:3515 [inline] kmem_cache_free+0x11a/0x2e0 mm/slub.c:3531 kernfs_put+0x3d9/0x540 fs/kernfs/dir.c:547 sysfs_put include/linux/sysfs.h:641 [inline] __kobject_del+0x10e/0x300 lib/kobject.c:621 kobject_del+0x45/0x60 lib/kobject.c:643 ext4_unregister_sysfs+0x91/0xa0 fs/ext4/sysfs.c:558 ext4_put_super+0x80/0xd70 fs/ext4/super.c:1180 generic_shutdown_super+0x14f/0x2d0 fs/super.c:465 kill_block_super+0x80/0xe0 fs/super.c:1395 deactivate_locked_super+0xb0/0x100 fs/super.c:335 deactivate_super+0xa5/0xd0 fs/super.c:366 cleanup_mnt+0x45f/0x510 fs/namespace.c:1143 __cleanup_mnt+0x19/0x20 fs/namespace.c:1150 task_work_run+0x147/0x1b0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0xfd/0x110 kernel/entry/common.c:175 exit_to_user_mode_prepare kernel/entry/common.c:207 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x79/0xc0 kernel/entry/common.c:300 do_syscall_64+0x50/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88815c2ac708 which belongs to the cache kernfs_node_cache of size 136 The buggy address is located 0 bytes inside of 136-byte region [ffff88815c2ac708, ffff88815c2ac790) The buggy address belongs to the page: page:ffffea000570ab00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x15c2ac flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea00053ea080 0000001200000012 ffff888100276900 raw: 0000000000000000 0000000000140014 00000001ffffffff 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 17856, ts 2114119632804, free_ts 2114088299886 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1ab/0x1b0 mm/page_alloc.c:2495 prep_new_page mm/page_alloc.c:2501 [inline] get_page_from_freelist+0x38b/0x400 mm/page_alloc.c:4281 __alloc_pages+0x3a8/0x7c0 mm/page_alloc.c:5548 allocate_slab+0x62/0x580 mm/slub.c:1928 new_slab mm/slub.c:1991 [inline] ___slab_alloc+0x2e2/0x6f0 mm/slub.c:3024 __slab_alloc+0x4a/0x90 mm/slub.c:3111 slab_alloc_node mm/slub.c:3202 [inline] slab_alloc mm/slub.c:3244 [inline] kmem_cache_alloc+0x205/0x2f0 mm/slub.c:3249 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xdb/0x6e0 fs/kernfs/dir.c:593 kernfs_new_node+0x97/0x170 fs/kernfs/dir.c:655 __kernfs_create_file+0x4a/0x270 fs/kernfs/file.c:985 sysfs_add_file_mode_ns+0x273/0x320 fs/sysfs/file.c:317 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x55e/0xf60 fs/sysfs/group.c:149 internal_create_groups fs/sysfs/group.c:189 [inline] sysfs_create_groups+0x5d/0x130 fs/sysfs/group.c:215 create_dir lib/kobject.c:100 [inline] kobject_add_internal+0x8de/0xda0 lib/kobject.c:255 kobject_add_varg lib/kobject.c:390 [inline] kobject_init_and_add+0x123/0x190 lib/kobject.c:473 ext4_register_sysfs+0xc0/0x2c0 fs/ext4/sysfs.c:524 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1364 [inline] free_pcp_prepare+0x448/0x450 mm/page_alloc.c:1435 free_unref_page_prepare mm/page_alloc.c:3433 [inline] free_unref_page+0x9c/0x370 mm/page_alloc.c:3513 free_the_page mm/page_alloc.c:706 [inline] __free_pages+0xd8/0x100 mm/page_alloc.c:5621 __vunmap+0x846/0x980 mm/vmalloc.c:2651 free_work+0x66/0x90 mm/vmalloc.c:96 process_one_work+0x6db/0xc00 kernel/workqueue.c:2313 worker_thread+0xb3e/0x1340 kernel/workqueue.c:2460 kthread+0x41c/0x500 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 Memory state around the buggy address: ffff88815c2ac600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88815c2ac680: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc >ffff88815c2ac700: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88815c2ac780: fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ffff88815c2ac800: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc ==================================================================