================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1375 [inline] BUG: KASAN: slab-use-after-free in gfs2_qd_dealloc+0x7a/0xf0 fs/gfs2/quota.c:115 Write of size 4 at addr ffff8880001dca78 by task syz-executor.1/5225 CPU: 0 PID: 5225 Comm: syz-executor.1 Not tainted 6.6.0-syzkaller-15029-gbe3ca57cfb77 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0xef/0x190 mm/kasan/generic.c:187 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1375 [inline] gfs2_qd_dealloc+0x7a/0xf0 fs/gfs2/quota.c:115 rcu_do_batch kernel/rcu/tree.c:2153 [inline] rcu_core+0x830/0x1c50 kernel/rcu/tree.c:2417 __do_softirq+0x21a/0x968 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:check_kcov_mode kernel/kcov.c:173 [inline] RIP: 0010:write_comp_data+0x19/0x80 kernel/kcov.c:236 Code: 8b 80 f0 15 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 49 89 d2 49 89 f8 49 89 f1 65 48 8b 14 25 c0 bc 03 00 65 8b 05 ff 25 7b 7e 00 01 ff 00 74 0f f6 c4 01 74 59 8b 82 fc 15 00 00 85 c0 74 4f RSP: 0018:ffffc90003e4f390 EFLAGS: 00000293 RAX: 0000000080000001 RBX: ffffc90003e4f418 RCX: ffffffff813a885c RDX: ffff88801c814800 RSI: ffffc90003e4fe48 RDI: 0000000000000006 RBP: ffffc90003e4fef0 R08: 0000000000000006 R09: ffffc90003e4fe48 R10: ffffc90003e4fef0 R11: 0000000000000000 R12: ffffc90003e48000 R13: ffffc90003e50000 R14: ffffc90003e4fef8 R15: ffffc90003e4fe48 unwind_next_frame+0x122c/0x2390 arch/x86/kernel/unwind_orc.c:665 arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x96/0xd0 kernel/stacktrace.c:122 save_stack+0x160/0x1f0 mm/page_owner.c:128 __reset_page_owner+0x5a/0x190 mm/page_owner.c:149 reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2347 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2533 release_pages+0x32a/0x14e0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] shmem_undo_range+0x57a/0x1030 mm/shmem.c:1004 shmem_truncate_range mm/shmem.c:1096 [inline] shmem_evict_inode+0x39f/0xba0 mm/shmem.c:1224 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:733 [inline] dput+0x8b7/0xf80 fs/dcache.c:913 __fput+0x3b9/0xbb0 fs/file_table.c:402 task_work_run+0x14d/0x240 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 __do_fast_syscall_32+0x6d/0xe0 arch/x86/entry/common.c:233 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:255 entry_SYSENTER_compat_after_hwframe+0x70/0x7a RIP: 0023:0xf7fe4579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000ffd2b708 EFLAGS: 00000292 ORIG_RAX: 0000000000000034 RAX: 0000000000000000 RBX: 00000000ffd2b7b0 RCX: 000000000000000a RDX: 00000000f7353ff4 RSI: 00000000f72a53bd RDI: 00000000ffd2c854 RBP: 00000000ffd2b7b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 6388: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] init_sbd fs/gfs2/ops_fstype.c:77 [inline] gfs2_fill_super+0x141/0x2bf0 fs/gfs2/ops_fstype.c:1161 get_tree_bdev+0x3b5/0x650 fs/super.c:1598 gfs2_get_tree+0x4e/0x280 fs/gfs2/ops_fstype.c:1345 vfs_get_tree+0x8c/0x370 fs/super.c:1771 do_new_mount fs/namespace.c:3337 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3863 do_syscall_32_irqs_on arch/x86/entry/common.c:164 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:230 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:255 entry_SYSENTER_compat_after_hwframe+0x70/0x7a Freed by task 5225: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xc0/0x180 mm/slub.c:3822 generic_shutdown_super+0x161/0x3c0 fs/super.c:696 kill_block_super+0x3b/0x90 fs/super.c:1667 gfs2_kill_sb+0x361/0x410 fs/gfs2/ops_fstype.c:1808 deactivate_locked_super+0xbc/0x1a0 fs/super.c:484 deactivate_super+0xde/0x100 fs/super.c:517 cleanup_mnt+0x222/0x450 fs/namespace.c:1256 task_work_run+0x14d/0x240 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 __do_fast_syscall_32+0x6d/0xe0 arch/x86/entry/common.c:233 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:255 entry_SYSENTER_compat_after_hwframe+0x70/0x7a The buggy address belongs to the object at ffff8880001dc000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 2680 bytes inside of freed 8192-byte region [ffff8880001dc000, ffff8880001de000) The buggy address belongs to the physical page: page:ffffea0000007600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d8 head:ffffea0000007600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x7ff00000000840(slab|head|node=0|zone=0|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 007ff00000000840 ffff888013043180 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080020002 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5451, tgid 5449 (syz-executor.3), ts 166310188082, free_ts 165161950864 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36c0 mm/page_alloc.c:3312 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4568 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x4f/0x100 mm/slab_common.c:1020 kmalloc_array include/linux/slab.h:637 [inline] kcalloc include/linux/slab.h:668 [inline] cache_create_net+0xa0/0x220 net/sunrpc/cache.c:1749 rsc_cache_create_net net/sunrpc/auth_gss/svcauth_gss.c:2062 [inline] gss_svc_init_net+0x69/0x660 net/sunrpc/auth_gss/svcauth_gss.c:2090 ops_init+0xb9/0x650 net/core/net_namespace.c:136 setup_net+0x422/0xa40 net/core/net_namespace.c:339 copy_net_ns+0x2fa/0x670 net/core/net_namespace.c:491 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 copy_namespaces+0x464/0x560 kernel/nsproxy.c:179 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2347 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487 __unfreeze_partials+0x21d/0x240 mm/slub.c:2655 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x195/0x310 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x4f/0x100 mm/slab_common.c:1020 kmalloc_array include/linux/slab.h:637 [inline] kcalloc include/linux/slab.h:668 [inline] ext4_find_extent+0x958/0xce0 fs/ext4/extents.c:914 ext4_ext_map_blocks+0x26b/0x5b10 fs/ext4/extents.c:4101 ext4_map_blocks+0x844/0x1770 fs/ext4/inode.c:548 ext4_mpage_readpages+0xfeb/0x1a10 fs/ext4/readpage.c:290 ext4_readahead+0x102/0x140 fs/ext4/inode.c:3148 read_pages+0x1d1/0xdb0 mm/readahead.c:160 page_cache_ra_unbounded+0x2e7/0x5e0 mm/readahead.c:241 do_page_cache_ra mm/readahead.c:299 [inline] page_cache_ra_order+0x72b/0xa80 mm/readahead.c:546 Memory state around the buggy address: ffff8880001dc900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880001dc980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880001dca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880001dca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880001dcb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 8b 80 f0 15 00 00 mov 0x15f0(%rax),%eax 6: c3 ret 7: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) e: 00 00 00 11: 49 89 d2 mov %rdx,%r10 14: 49 89 f8 mov %rdi,%r8 17: 49 89 f1 mov %rsi,%r9 1a: 65 48 8b 14 25 c0 bc mov %gs:0x3bcc0,%rdx 21: 03 00 23: 65 8b 05 ff 25 7b 7e mov %gs:0x7e7b25ff(%rip),%eax # 0x7e7b2629 * 2a: a9 00 01 ff 00 test $0xff0100,%eax <-- trapping instruction 2f: 74 0f je 0x40 31: f6 c4 01 test $0x1,%ah 34: 74 59 je 0x8f 36: 8b 82 fc 15 00 00 mov 0x15fc(%rdx),%eax 3c: 85 c0 test %eax,%eax 3e: 74 4f je 0x8f