audit: type=1326 audit(1656779219.886:16): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=10999 comm="syz-executor.2" exe="/syz-executor.2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f860cb37b19 code=0x0 ------------[ cut here ]------------ kernfs_put: syz5/pids.events: released with incorrect active_ref 0 ------------[ cut here ]------------ WARNING: CPU: 1 PID: 5262 at fs/kernfs/dir.c:531 kernfs_put.part.0+0x433/0x540 WARNING: CPU: 0 PID: 11170 at fs/kernfs/dir.c:504 kernfs_get.part.0+0x69/0x80 Modules linked in: Modules linked in: CPU: 0 PID: 11170 Comm: syz-executor.0 Not tainted 5.19.0-rc4-next-20220701 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 CPU: 1 PID: 5262 Comm: kworker/1:0 Not tainted 5.19.0-rc4-next-20220701 #1 RIP: 0010:kernfs_get.part.0+0x69/0x80 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Code: 31 ff 89 ee e8 a8 43 a7 ff 85 ed 74 18 e8 cf 46 a7 ff be 04 00 00 00 48 89 df e8 52 be d9 ff f0 ff 03 5b 5d c3 e8 b7 46 a7 ff <0f> 0b eb df 48 89 df e8 fb ba d9 ff eb c6 66 0f 1f 84 00 00 00 00 RSP: 0018:ffff88806ce09c80 EFLAGS: 00010046 Workqueue: events kernfs_notify_workfn RAX: 0000000000000000 RBX: ffff88801d3b5bc8 RCX: 0000000000000100 RDX: ffff88804590d040 RSI: ffffffff819d2579 RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 RIP: 0010:kernfs_put.part.0+0x433/0x540 R13: 1ffffffff0a01e40 R14: ffff88801d3b5bc8 R15: ffff888043a54530 Code: 03 80 3c 18 00 0f 85 ea 00 00 00 4d 8b 7d 38 e8 53 42 a7 ff 48 8b 14 24 44 89 f1 4c 89 fe 48 c7 c7 a0 58 72 84 e8 97 1c 6c 02 <0f> 0b e9 b9 fc ff ff 48 89 ef e8 8e b6 d9 ff e9 c1 fd ff ff e8 84 FS: 00007fc4ba175700(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 RSP: 0018:ffff888044b6fbd8 EFLAGS: 00010286 CR2: 0000001b2d925000 CR3: 0000000045998000 CR4: 0000000000350ef0 DR0: 0100000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000600 Call Trace: kernfs_get+0x1b/0x30 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 kernfs_notify+0x180/0x350 RDX: ffff8880453f1ac0 RSI: ffffffff812b6848 RDI: ffffed100896df6d cgroup_file_notify+0xf5/0x1a0 RBP: ffff88801d3b5c00 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: ffff88801d3b5bc8 call_timer_fn+0x17d/0x5f0 R13: ffff888017431828 R14: 0000000000000000 R15: ffff888018ab31b8 FS: 0000000000000000(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555556396c58 CR3: 000000004a8d4000 CR4: 0000000000350ee0 __run_timers.part.0+0x65e/0xa50 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000400 Call Trace: run_timer_softirq+0xae/0x1a0 __do_softirq+0x1c8/0x8cc __irq_exit_rcu+0x113/0x170 kernfs_put+0x42/0x50 irq_exit_rcu+0x5/0x20 sysvec_apic_timer_interrupt+0x8e/0xc0 kernfs_notify_workfn+0x417/0x560 asm_sysvec_apic_timer_interrupt+0x1b/0x20 RIP: 0010:write_comp_data+0x0/0x90 Code: 06 be 7e 81 e2 00 01 ff 00 75 10 65 48 8b 04 25 c0 6e 02 00 48 8b 80 28 14 00 00 c3 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 <49> 89 f1 49 89 d2 49 89 f8 65 8b 05 c0 06 be 7e 89 c6 81 e6 00 01 RSP: 0018:ffff88804688f698 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8153a7bc RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000007 process_one_work+0xa0f/0x1690 RBP: ffff8880449085c8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 R13: ffff88806ce33880 R14: ffff88804688f7c0 R15: ffff8880449085c8 worker_thread+0x637/0x1250 perf_swevent_event+0x6c/0x550 kthread+0x2ed/0x3a0 perf_tp_event+0x2e5/0xbc0 ret_from_fork+0x22/0x30 irq event stamp: 367629 hardirqs last enabled at (367641): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 hardirqs last disabled at (367650): [] sysvec_apic_timer_interrupt+0xb/0xc0 perf_trace_run_bpf_submit+0xf5/0x1d0 softirqs last enabled at (365864): [] __irq_exit_rcu+0x113/0x170 perf_trace_lock+0x308/0x560 softirqs last disabled at (365855): [] __irq_exit_rcu+0x113/0x170 ---[ end trace 0000000000000000 ]--- ================================================================== BUG: KASAN: use-after-free in llist_del_first+0x89/0xa0 Read of size 8 at addr ffff88801d3b5c48 by task kworker/1:0/5262 CPU: 1 PID: 5262 Comm: kworker/1:0 Tainted: G W 5.19.0-rc4-next-20220701 #1 lock_release+0x4aa/0x750 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: events kernfs_notify_workfn Call Trace: _raw_spin_unlock+0x12/0x40 dump_stack_lvl+0x8b/0xb3 futex_wait_queue+0x83/0x3b0 print_report.cold+0x5e/0x5e1 futex_wait+0x28e/0x690 kasan_report+0xb1/0x1b0 llist_del_first+0x89/0xa0 kernfs_notify_workfn+0x78/0x560 do_futex+0x2fb/0x380 process_one_work+0xa0f/0x1690 __x64_sys_futex+0x1c6/0x4c0 worker_thread+0x637/0x1250 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 kthread+0x2ed/0x3a0 RIP: 0033:0x7fc4bcc62b19 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 bc ff ff ff f7 d8 64 89 01 48 ret_from_fork+0x22/0x30 RSP: 002b:00007fc4ba175218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: ffffffffffffffda RBX: 00007fc4bcd761a8 RCX: 00007fc4bcc62b19 Allocated by task 300: RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fc4bcd761a8 kasan_save_stack+0x1e/0x40 RBP: 00007fc4bcd761a0 R08: 0000000000000000 R09: 0000000000000000 __kasan_slab_alloc+0x66/0x80 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc4bcd761ac kmem_cache_alloc+0x1b1/0x490 R13: 00007ffd9bc6027f R14: 00007fc4ba175300 R15: 0000000000022000 __kernfs_new_node+0xd4/0x8b0 kernfs_new_node+0x93/0x120 irq event stamp: 57 __kernfs_create_file+0x51/0x350 hardirqs last enabled at (56): [] _raw_spin_unlock_irq+0x1f/0x40 cgroup_addrm_files+0x3e2/0x9d0 hardirqs last disabled at (57): [] _raw_spin_lock_irqsave+0x4e/0x50 css_populate_dir+0x19b/0x450 softirqs last enabled at (0): [] copy_process+0x1dfa/0x6d60 cgroup_apply_control_enable+0x3ae/0xa40 softirqs last disabled at (53): [] __irq_exit_rcu+0x113/0x170 cgroup_mkdir+0x824/0x11f0 ---[ end trace 0000000000000000 ]--- kernfs_iop_mkdir+0x149/0x1d0 vfs_mkdir+0x417/0x6a0 do_mkdirat+0x17b/0x2e0 __x64_sys_mkdir+0xf2/0x140 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 5262: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 __kasan_slab_free+0x108/0x190 kmem_cache_free+0xfb/0x600 kernfs_put.part.0+0x2c7/0x540 kernfs_put+0x42/0x50 ------------[ cut here ]------------ kernfs_notify_workfn+0x417/0x560 WARNING: CPU: 0 PID: 11087 at fs/kernfs/dir.c:504 kernfs_get.part.0+0x69/0x80 process_one_work+0xa0f/0x1690 Modules linked in: worker_thread+0x637/0x1250 kthread+0x2ed/0x3a0 CPU: 0 PID: 11087 Comm: syz-executor.3 Tainted: G W 5.19.0-rc4-next-20220701 #1 ret_from_fork+0x22/0x30 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:kernfs_get.part.0+0x69/0x80 The buggy address belongs to the object at ffff88801d3b5bc8 which belongs to the cache kernfs_node_cache of size 168 Code: 31 ff 89 ee e8 a8 43 a7 ff 85 ed 74 18 e8 cf 46 a7 ff be 04 00 00 00 48 89 df e8 52 be d9 ff f0 ff 03 5b 5d c3 e8 b7 46 a7 ff <0f> 0b eb df 48 89 df e8 fb ba d9 ff eb c6 66 0f 1f 84 00 00 00 00 The buggy address is located 128 bytes inside of 168-byte region [ffff88801d3b5bc8, ffff88801d3b5c70) RSP: 0018:ffff888017247a60 EFLAGS: 00010046 RAX: 0000000000040000 RBX: ffff88801d1aecb0 RCX: ffffc90005c4d000 The buggy address belongs to the physical page: RDX: 0000000000040000 RSI: ffffffff819d2579 RDI: 0000000000000005 page:000000006cc501b0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d3b5 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 flags: 0x100000000000200(slab|node=0|zone=1) R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 raw: 0100000000000200 0000000000000000 dead000000000122 ffff8880080718c0 R13: 1ffffffff0a01e40 R14: ffff88801d1aecb0 R15: ffff888044f94490 raw: 0000000000000000 0000000000110011 00000001ffffffff 0000000000000000 FS: 00007f2b388a0700(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000 page dumped because: kasan: bad access detected CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe7c4036018 CR3: 000000004a8d4000 CR4: 0000000000350ef0 Memory state around the buggy address: DR0: 0100000000000000 DR1: 0000000000000000 DR2: 0000000000000000 ffff88801d3b5b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000600 ffff88801d3b5b80: 00 fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb Call Trace: >ffff88801d3b5c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ^ kernfs_get+0x1b/0x30 ffff88801d3b5c80: fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 kernfs_notify+0x180/0x350 ffff88801d3b5d00: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc cgroup_file_notify+0xf5/0x1a0 ================================================================== try_charge_memcg+0x461/0x13c0 mem_cgroup_charge_skmem+0x7c/0x1b0 sock_setsockopt+0x2080/0x34a0 __sys_setsockopt+0x258/0x2a0 __x64_sys_setsockopt+0xba/0x150 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f2b3b34bb19 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2b388a0188 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f2b3b45f020 RCX: 00007f2b3b34bb19 RDX: 0000000000000049 RSI: 0000000000000001 RDI: 0000000000000004 RBP: 00007f2b3b3a5f6d R08: 0000000000000010 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffff701772f R14: 00007f2b388a0300 R15: 0000000000022000 irq event stamp: 3728 hardirqs last enabled at (3727): [] _raw_spin_unlock_irqrestore+0x28/0x50 hardirqs last disabled at (3728): [] _raw_spin_lock_irqsave+0x4e/0x50 softirqs last enabled at (3724): [] __irq_exit_rcu+0x113/0x170 softirqs last disabled at (3715): [] __irq_exit_rcu+0x113/0x170 ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess), 1 bytes skipped: 0: be 7e 81 e2 00 mov $0xe2817e,%esi 5: 01 ff add %edi,%edi 7: 00 75 10 add %dh,0x10(%rbp) a: 65 48 8b 04 25 c0 6e mov %gs:0x26ec0,%rax 11: 02 00 13: 48 8b 80 28 14 00 00 mov 0x1428(%rax),%rax 1a: c3 retq 1b: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1) 22: 00 00 00 00 26: 0f 1f 00 nopl (%rax) * 29: 49 89 f1 mov %rsi,%r9 <-- trapping instruction 2c: 49 89 d2 mov %rdx,%r10 2f: 49 89 f8 mov %rdi,%r8 32: 65 8b 05 c0 06 be 7e mov %gs:0x7ebe06c0(%rip),%eax # 0x7ebe06f9 39: 89 c6 mov %eax,%esi 3b: 81 .byte 0x81 3c: e6 00 out %al,$0x0 3e: 01 .byte 0x1