================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_dec include/linux/atomic/atomic-instrumented.h:244 [inline] BUG: KASAN: use-after-free in gfs2_qd_dispose fs/gfs2/quota.c:137 [inline] BUG: KASAN: use-after-free in gfs2_qd_shrink_scan+0x63d/0x860 fs/gfs2/quota.c:175 Write of size 4 at addr ffff88802397ca70 by task syz.0.733/5805 CPU: 1 PID: 5805 Comm: syz.0.733 Not tainted 5.15.168-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_dec include/linux/atomic/atomic-instrumented.h:244 [inline] gfs2_qd_dispose fs/gfs2/quota.c:137 [inline] gfs2_qd_shrink_scan+0x63d/0x860 fs/gfs2/quota.c:175 do_shrink_slab+0x542/0xda0 mm/vmscan.c:758 shrink_slab+0x233/0x960 mm/vmscan.c:918 drop_slab_node+0xed/0x180 mm/vmscan.c:953 drop_slab+0x8b/0x120 mm/vmscan.c:963 drop_caches_sysctl_handler+0xb3/0x160 fs/drop_caches.c:66 proc_sys_call_handler+0x541/0x8a0 fs/proc/proc_sysctl.c:585 do_iter_readv_writev+0x594/0x7a0 do_iter_write+0x1e6/0x760 fs/read_write.c:855 vfs_writev fs/read_write.c:928 [inline] do_writev+0x281/0x470 fs/read_write.c:971 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f8323842ff9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8321c9a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f83239fb058 RCX: 00007f8323842ff9 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 00007f83238b5296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f83239fb058 R15: 00007ffce4f135e8 Allocated by task 4666: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] init_sbd fs/gfs2/ops_fstype.c:77 [inline] gfs2_fill_super+0x15a/0x2750 fs/gfs2/ops_fstype.c:1151 get_tree_bdev+0x3fe/0x620 fs/super.c:1325 gfs2_get_tree+0x50/0x210 fs/gfs2/ops_fstype.c:1332 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x2ba/0xb40 fs/namespace.c:3012 do_mount fs/namespace.c:3355 [inline] __do_sys_mount fs/namespace.c:3563 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 3582: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xf1/0x270 mm/slub.c:4559 generic_shutdown_super+0x130/0x310 fs/super.c:475 kill_block_super+0x7a/0xe0 fs/super.c:1427 deactivate_locked_super+0xa0/0x110 fs/super.c:335 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88802397c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 2672 bytes inside of 8192-byte region [ffff88802397c000, ffff88802397e000) The buggy address belongs to the page: page:ffffea00008e5e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x23978 head:ffffea00008e5e00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000100000001 ffff888017042280 raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3746, ts 54190137078, free_ts 54185905429 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc_trace+0x1a0/0x290 mm/slub.c:3245 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] tomoyo_print_bprm security/tomoyo/audit.c:26 [inline] tomoyo_init_log+0x1140/0x1fe0 security/tomoyo/audit.c:264 tomoyo_supervisor+0x3b8/0x12c0 security/tomoyo/common.c:2097 tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline] tomoyo_env_perm+0x174/0x210 security/tomoyo/environ.c:63 tomoyo_environ security/tomoyo/domain.c:672 [inline] tomoyo_find_next_domain+0x1469/0x1d40 security/tomoyo/domain.c:882 tomoyo_bprm_check_security+0xdb/0x120 security/tomoyo/tomoyo.c:101 security_bprm_check+0x5f/0xa0 security/security.c:868 search_binary_handler fs/exec.c:1733 [inline] exec_binprm fs/exec.c:1786 [inline] bprm_execve+0x84e/0x17c0 fs/exec.c:1855 do_execveat_common+0x583/0x720 fs/exec.c:1960 do_execve fs/exec.c:2030 [inline] __do_sys_execve fs/exec.c:2106 [inline] __se_sys_execve fs/exec.c:2101 [inline] __x64_sys_execve+0x8e/0xa0 fs/exec.c:2101 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587 do_slab_free mm/slub.c:3487 [inline] ___cache_free+0xe3/0x100 mm/slub.c:3506 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0x120/0x300 mm/slub.c:4403 kmalloc include/linux/slab.h:596 [inline] tomoyo_add_entry security/tomoyo/common.c:2031 [inline] tomoyo_supervisor+0xe67/0x12c0 security/tomoyo/common.c:2103 tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline] tomoyo_env_perm+0x174/0x210 security/tomoyo/environ.c:63 tomoyo_environ security/tomoyo/domain.c:672 [inline] tomoyo_find_next_domain+0x1469/0x1d40 security/tomoyo/domain.c:882 tomoyo_bprm_check_security+0xdb/0x120 security/tomoyo/tomoyo.c:101 security_bprm_check+0x5f/0xa0 security/security.c:868 search_binary_handler fs/exec.c:1733 [inline] exec_binprm fs/exec.c:1786 [inline] bprm_execve+0x84e/0x17c0 fs/exec.c:1855 Memory state around the buggy address: ffff88802397c900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802397c980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802397ca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802397ca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802397cb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================