================================================================== 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:1383 [inline] BUG: KASAN: slab-use-after-free in gfs2_qd_dealloc+0x81/0xe0 fs/gfs2/quota.c:112 Write of size 4 at addr ffff88803eb10a80 by task udevd/5357 CPU: 0 UID: 0 PID: 5357 Comm: udevd Not tainted 6.16.0-rc7-syzkaller-00120-g5f33ebd2018c #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1383 [inline] gfs2_qd_dealloc+0x81/0xe0 fs/gfs2/quota.c:112 rcu_do_batch kernel/rcu/tree.c:2576 [inline] rcu_core+0xca8/0x1710 kernel/rcu/tree.c:2832 handle_softirqs+0x286/0x870 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:rcu_is_watching_curr_cpu include/linux/context_tracking.h:128 [inline] RIP: 0010:rcu_is_watching+0x3a/0xb0 kernel/rcu/tree.c:745 Code: e8 3b 76 c8 09 89 c3 83 f8 08 73 65 49 bf 00 00 00 00 00 fc ff df 4c 8d 34 dd 70 fc bb 8d 4c 89 f0 48 c1 e8 03 42 80 3c 38 00 <74> 08 4c 89 f7 e8 cc 85 7c 00 48 c7 c3 58 af a1 92 49 03 1e 48 89 RSP: 0018:ffffc9000d5a7898 EFLAGS: 00000246 RAX: 1ffffffff1b77f8e RBX: 0000000000000000 RCX: 14d36a4f7f59e900 RDX: ffffc9000d5a7a01 RSI: ffffffff8be29f20 RDI: ffffffff8be29ee0 RBP: dffffc0000000000 R08: ffffc9000d5a79d8 R09: 0000000000000000 R10: ffffc9000d5a7a38 R11: fffff52001ab4f49 R12: ffffc9000d5a79e8 R13: ffffc9000d5a0000 R14: ffffffff8dbbfc70 R15: dffffc0000000000 rcu_read_unlock include/linux/rcupdate.h:869 [inline] class_rcu_destructor include/linux/rcupdate.h:1155 [inline] unwind_next_frame+0x1965/0x2390 arch/x86/kernel/unwind_orc.c:680 __unwind_start+0x5b9/0x760 arch/x86/kernel/unwind_orc.c:758 unwind_start arch/x86/include/asm/unwind.h:64 [inline] arch_stack_walk+0xe4/0x150 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2381 [inline] slab_free mm/slub.c:4643 [inline] kmem_cache_free+0x18f/0x400 mm/slub.c:4745 do_unlinkat+0x509/0x560 fs/namei.c:4682 __do_sys_unlink fs/namei.c:4705 [inline] __se_sys_unlink fs/namei.c:4703 [inline] __x64_sys_unlink+0x47/0x50 fs/namei.c:4703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc362315937 Code: 00 00 e9 a9 fd ff ff 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 5f 00 00 00 0f 05 c3 0f 1f 84 00 00 00 00 00 b8 57 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 91 b4 0d 00 f7 d8 64 89 02 b8 RSP: 002b:00007ffdf2b48c88 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc362315937 RDX: 0000000000000000 RSI: 00000000000003e4 RDI: 00007ffdf2b48ca0 RBP: 0000560e9fec5980 R08: 0000000000000000 R09: 0000000000000020 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffdf2b48ca0 R13: 0000560e9feba370 R14: 0000560e96eea100 R15: 0000560e96eea140 Allocated by task 5350: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4359 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] init_sbd fs/gfs2/ops_fstype.c:78 [inline] gfs2_fill_super+0x11c/0x20e0 fs/gfs2/ops_fstype.c:1128 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1681 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1335 vfs_get_tree+0x92/0x2b0 fs/super.c:1804 do_new_mount+0x24a/0xa40 fs/namespace.c:3902 do_mount fs/namespace.c:4239 [inline] __do_sys_mount fs/namespace.c:4450 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4427 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5350: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2381 [inline] slab_free mm/slub.c:4643 [inline] kfree+0x18e/0x440 mm/slub.c:4842 free_sbd fs/gfs2/ops_fstype.c:71 [inline] gfs2_fill_super+0x153d/0x20e0 fs/gfs2/ops_fstype.c:1319 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1681 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1335 vfs_get_tree+0x92/0x2b0 fs/super.c:1804 do_new_mount+0x24a/0xa40 fs/namespace.c:3902 do_mount fs/namespace.c:4239 [inline] __do_sys_mount fs/namespace.c:4450 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4427 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803eb10000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 2688 bytes inside of freed 8192-byte region [ffff88803eb10000, ffff88803eb12000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3eb10 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801a442280 0000000000000000 0000000000000001 raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801a442280 0000000000000000 0000000000000001 head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 04fff00000000003 ffffea0000fac401 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5316, tgid 5316 (nohup), ts 70115478114, free_ts 69567870613 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419 alloc_slab_page mm/slub.c:2451 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2619 new_slab mm/slub.c:2673 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3859 __slab_alloc mm/slub.c:3949 [inline] __slab_alloc_node mm/slub.c:4024 [inline] slab_alloc_node mm/slub.c:4185 [inline] __kmalloc_cache_noprof+0x296/0x3d0 mm/slub.c:4354 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] tomoyo_print_bprm security/tomoyo/audit.c:26 [inline] tomoyo_init_log+0x111f/0x1f70 security/tomoyo/audit.c:264 tomoyo_supervisor+0x340/0x1480 security/tomoyo/common.c:2198 tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline] tomoyo_env_perm+0x149/0x1e0 security/tomoyo/environ.c:63 tomoyo_environ security/tomoyo/domain.c:672 [inline] tomoyo_find_next_domain+0x15cf/0x1aa0 security/tomoyo/domain.c:888 tomoyo_bprm_check_security+0x11c/0x180 security/tomoyo/tomoyo.c:102 security_bprm_check+0x89/0x270 security/security.c:1302 search_binary_handler fs/exec.c:1660 [inline] exec_binprm fs/exec.c:1702 [inline] bprm_execve+0x8ee/0x1450 fs/exec.c:1754 do_execveat_common+0x510/0x6a0 fs/exec.c:1860 do_execve fs/exec.c:1934 [inline] __do_sys_execve fs/exec.c:2010 [inline] __se_sys_execve fs/exec.c:2005 [inline] __x64_sys_execve+0x94/0xb0 fs/exec.c:2005 page last free pid 5310 tgid 5310 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0xc71/0xe70 mm/page_alloc.c:2706 __folio_put+0x21b/0x2c0 mm/swap.c:112 put_netmem net/core/skbuff.c:7372 [inline] skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x49a/0x7c0 net/core/skbuff.c:1081 skb_release_all net/core/skbuff.c:1152 [inline] kfree_skb_add_bulk net/core/skbuff.c:1225 [inline] kfree_skb_list_reason+0x25d/0x460 net/core/skbuff.c:1247 skb_release_data+0x61e/0x7c0 net/core/skbuff.c:1085 skb_release_all net/core/skbuff.c:1152 [inline] __napi_kfree_skb net/core/skbuff.c:1442 [inline] kfree_skb_napi_cache net/core/skbuff.c:7168 [inline] skb_attempt_defer_free+0x422/0x5c0 net/core/skbuff.c:7190 tcp_eat_recv_skb net/ipv4/tcp.c:1565 [inline] tcp_recvmsg_locked+0x249d/0x3660 net/ipv4/tcp.c:2862 tcp_recvmsg+0x216/0x810 net/ipv4/tcp.c:2908 inet_recvmsg+0x147/0x250 net/ipv4/af_inet.c:883 sock_recvmsg_nosec net/socket.c:1017 [inline] sock_recvmsg+0x1a8/0x270 net/socket.c:1039 sock_read_iter+0x231/0x2f0 net/socket.c:1109 new_sync_read fs/read_write.c:491 [inline] vfs_read+0x4d0/0x980 fs/read_write.c:572 ksys_read+0x145/0x250 fs/read_write.c:715 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88803eb10980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803eb10a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88803eb10a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803eb10b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803eb10b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: e8 3b 76 c8 09 call 0x9c87640 5: 89 c3 mov %eax,%ebx 7: 83 f8 08 cmp $0x8,%eax a: 73 65 jae 0x71 c: 49 bf 00 00 00 00 00 movabs $0xdffffc0000000000,%r15 13: fc ff df 16: 4c 8d 34 dd 70 fc bb lea -0x72440390(,%rbx,8),%r14 1d: 8d 1e: 4c 89 f0 mov %r14,%rax 21: 48 c1 e8 03 shr $0x3,%rax 25: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1) * 2a: 74 08 je 0x34 <-- trapping instruction 2c: 4c 89 f7 mov %r14,%rdi 2f: e8 cc 85 7c 00 call 0x7c8600 34: 48 c7 c3 58 af a1 92 mov $0xffffffff92a1af58,%rbx 3b: 49 03 1e add (%r14),%rbx 3e: 48 rex.W 3f: 89 .byte 0x89