loop2: detected capacity change from 0 to 8 ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x4346/0x6120 Read of size 8 at addr ffff888044be9458 by task syz-executor/14024 CPU: 0 PID: 14024 Comm: syz-executor Not tainted 5.19.0-rc3-next-20220623 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 print_report.cold+0x5e/0x5e8 kasan_report+0xbe/0x1c0 __lock_acquire+0x4346/0x6120 lock_acquire+0x1a2/0x530 _raw_spin_lock_irq+0x32/0x50 kmemleak_scan+0x21d/0x16b0 kmemleak_write+0x56c/0x680 full_proxy_write+0x11d/0x190 vfs_write+0x264/0xac0 ksys_write+0x127/0x250 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f50b01c15c3 Code: 16 00 00 00 eb ae 90 b8 6e 00 00 00 eb a6 e8 44 ef 04 00 0f 1f 40 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 18 RSP: 002b:00007ffff4821388 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007ffff48219c8 RCX: 00007f50b01c15c3 RDX: 0000000000000004 RSI: 00007f50b0277ed9 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000522 R09: 00007ffff48a9080 R10: 00007ffff48a9090 R11: 0000000000000246 R12: 00007f50b01c3b10 R13: 00007ffff4821ee2 R14: 0000000000000000 R15: 0000000000141034 Allocated by task 14026: kasan_save_stack+0x1e/0x40 __kasan_slab_alloc+0x66/0x80 kmem_cache_alloc+0x1b1/0x490 __create_object.isra.0+0x3d/0xc10 kmem_cache_alloc+0x247/0x490 __alloc_file+0x21/0x230 alloc_empty_file+0x6d/0x170 path_openat+0xe1/0x2870 do_filp_open+0x1aa/0x400 do_sys_openat2+0x16d/0x4c0 __x64_sys_openat+0x13f/0x1f0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 14027: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 ____kasan_slab_free+0x14b/0x1a0 kmem_cache_free+0xe7/0x5e0 rcu_core+0x7e2/0x2070 __do_softirq+0x270/0x8c7 Last potentially related work creation: kasan_save_stack+0x1e/0x40 __kasan_record_aux_stack+0x97/0xa0 call_rcu+0x6a/0xa20 kmem_cache_free+0x26e/0x5e0 rcu_core+0x7e2/0x2070 __do_softirq+0x270/0x8c7 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 __kasan_record_aux_stack+0x97/0xa0 call_rcu+0x6a/0xa20 kfree+0x1e1/0x5b0 ieee80211_bss_info_update+0x53d/0xb00 ieee80211_ibss_rx_queued_mgmt+0x1912/0x2ef0 ieee80211_iface_work+0xa71/0xce0 process_one_work+0xa1c/0x16a0 worker_thread+0x637/0x1250 kthread+0x2f2/0x3b0 ret_from_fork+0x22/0x30 The buggy address belongs to the object at ffff888044be9440 which belongs to the cache kmemleak_object of size 368 The buggy address is located 24 bytes inside of 368-byte region [ffff888044be9440, ffff888044be95b0) The buggy address belongs to the physical page: page:000000003049924a refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44be8 head:000000003049924a order:1 compound_mapcount:0 compound_pincount:0 flags: 0x100000000010200(slab|head|node=0|zone=1) raw: 0100000000010200 ffffea0000349780 dead000000000003 ffff88800784f780 raw: 0000000000000000 0000000000120012 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888044be9300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888044be9380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888044be9400: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff888044be9480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888044be9500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: (detected by 1, t=105006 jiffies, g=418597, q=24134 ncpus=2) rcu: All QSes seen, last rcu_preempt kthread activity 105006 (4296087395-4295982389), jiffies_till_next_fqs=3, root ->qsmask 0x0 rcu: rcu_preempt kthread timer wakeup didn't happen for 105003 jiffies! g418597 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x200 rcu: Possible timer handling issue on cpu=0 timer-softirq=145069 rcu: rcu_preempt kthread starved for 105006 jiffies! g418597 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x200 ->cpu=0 rcu: Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior. rcu: RCU grace-period kthread stack dump: task:rcu_preempt state:R stack:29416 pid: 14 ppid: 2 flags:0x00004000 Call Trace: __schedule+0x893/0x2490 schedule+0xd2/0x1f0 schedule_timeout+0x143/0x280 rcu_gp_fqs_loop+0x1f4/0xbd0 rcu_gp_kthread+0x3c1/0x5a0 kthread+0x2f2/0x3b0 ret_from_fork+0x22/0x30 rcu: Stack dump where RCU GP kthread last ran: Sending NMI from CPU 1 to CPUs 0: NMI backtrace for cpu 0 CPU: 0 PID: 14024 Comm: syz-executor Tainted: G B 5.19.0-rc3-next-20220623 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:kasan_check_range+0x0/0x1e0 Code: e8 e5 e2 ff ff 48 89 c3 48 85 c0 74 17 8b 40 08 40 0f b6 f5 bf 00 08 00 00 89 43 0c e8 c9 df ff ff 89 43 08 5b 5d 41 5c c3 90 <48> 85 f6 0f 84 8c 01 00 00 48 89 f8 41 54 44 0f b6 c2 55 53 48 01 RSP: 0018:ffff888046f57ae0 EFLAGS: 00000046 RAX: 0000000000000000 RBX: 000000000d25f0e0 RCX: ffffffff81298687 RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff888044be9440 RBP: ffff888044be9440 R08: 0000000000000000 R09: ffff888044be9443 R10: ffffed100897d288 R11: 0000000000000001 R12: 0000000000000003 R13: ffffed100897d288 R14: 0000000000000001 R15: 1ffff11008deaf5e FS: 0000555557113400(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffe04d0a000 CR3: 0000000046226000 CR4: 0000000000350ef0 Call Trace: queued_spin_lock_slowpath+0xa7/0xc80 do_raw_spin_lock+0x1d8/0x260 kmemleak_scan+0x21d/0x16b0 kmemleak_write+0x56c/0x680 full_proxy_write+0x11d/0x190 vfs_write+0x264/0xac0 ksys_write+0x127/0x250 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f50b01c15c3 Code: 16 00 00 00 eb ae 90 b8 6e 00 00 00 eb a6 e8 44 ef 04 00 0f 1f 40 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 18 RSP: 002b:00007ffff4821388 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007ffff48219c8 RCX: 00007f50b01c15c3 RDX: 0000000000000004 RSI: 00007f50b0277ed9 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000522 R09: 00007ffff48a9080 R10: 00007ffff48a9090 R11: 0000000000000246 R12: 00007f50b01c3b10 R13: 00007ffff4821ee2 R14: 0000000000000000 R15: 0000000000141034 INFO: task kworker/u4:2:33 blocked for more than 143 seconds. Tainted: G B 5.19.0-rc3-next-20220623 #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/u4:2 state:D stack:24784 pid: 33 ppid: 2 flags:0x00004000 Workqueue: events_unbound fsnotify_mark_destroy_workfn Call Trace: __schedule+0x893/0x2490 schedule+0xd2/0x1f0 schedule_timeout+0x1c5/0x280 __wait_for_common+0x36f/0x4b0 __synchronize_srcu+0x151/0x220 fsnotify_mark_destroy_workfn+0xf4/0x320 process_one_work+0xa1c/0x16a0 worker_thread+0x637/0x1250 kthread+0x2f2/0x3b0 ret_from_fork+0x22/0x30 INFO: lockdep is turned off. ---------------- Code disassembly (best guess): 0: e8 e5 e2 ff ff callq 0xffffe2ea 5: 48 89 c3 mov %rax,%rbx 8: 48 85 c0 test %rax,%rax b: 74 17 je 0x24 d: 8b 40 08 mov 0x8(%rax),%eax 10: 40 0f b6 f5 movzbl %bpl,%esi 14: bf 00 08 00 00 mov $0x800,%edi 19: 89 43 0c mov %eax,0xc(%rbx) 1c: e8 c9 df ff ff callq 0xffffdfea 21: 89 43 08 mov %eax,0x8(%rbx) 24: 5b pop %rbx 25: 5d pop %rbp 26: 41 5c pop %r12 28: c3 retq 29: 90 nop * 2a: 48 85 f6 test %rsi,%rsi <-- trapping instruction 2d: 0f 84 8c 01 00 00 je 0x1bf 33: 48 89 f8 mov %rdi,%rax 36: 41 54 push %r12 38: 44 0f b6 c2 movzbl %dl,%r8d 3c: 55 push %rbp 3d: 53 push %rbx 3e: 48 rex.W 3f: 01 .byte 0x1