netlink: 2552 bytes leftover after parsing attributes in process `syz-executor.3'. ------------[ cut here ]------------ kernfs_put: syz2/memory.events: released with incorrect active_ref 0 ------------[ cut here ]------------ WARNING: CPU: 1 PID: 35 at fs/kernfs/dir.c:531 kernfs_put.part.0+0x433/0x540 WARNING: CPU: 0 PID: 4878 at fs/kernfs/dir.c:504 kernfs_get.part.0+0x69/0x80 Modules linked in: Modules linked in: CPU: 0 PID: 4878 Comm: syz-executor.0 Not tainted 5.19.0-rc4-next-20220630 #1 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 CPU: 1 PID: 35 Comm: kworker/1:1 Not tainted 5.19.0-rc4-next-20220630 #1 Code: 31 ff 89 ee e8 c8 0b a7 ff 85 ed 74 18 e8 ef 0e a7 ff be 04 00 00 00 48 89 df e8 c2 c3 d9 ff f0 ff 03 5b 5d c3 e8 d7 0e a7 ff <0f> 0b eb df 48 89 df e8 6b c0 d9 ff eb c6 66 0f 1f 84 00 00 00 00 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RSP: 0018:ffff88806ce09c80 EFLAGS: 00010046 RAX: 0000000000000000 RBX: ffff88800ee04bc8 RCX: 0000000000000100 RDX: ffff888017dc0000 RSI: ffffffff819d50a9 RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 R13: 1ffffffff0a01e40 R14: ffff88800ee04bc8 R15: ffff88801716c490 FS: 00007f2615843700(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000 Workqueue: events kernfs_notify_workfn CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2e029000 CR3: 000000001b0aa000 CR4: 0000000000350ef0 Call Trace: kernfs_get+0x1b/0x30 kernfs_notify+0x180/0x350 cgroup_file_notify+0xf5/0x1a0 call_timer_fn+0x17d/0x5f0 __run_timers.part.0+0x65e/0xa50 run_timer_softirq+0xae/0x1a0 __do_softirq+0x270/0x8c7 __irq_exit_rcu+0x113/0x170 irq_exit_rcu+0x5/0x20 sysvec_apic_timer_interrupt+0x8e/0xc0 asm_sysvec_apic_timer_interrupt+0x1b/0x20 RIP: 0010:lock_is_held_type+0xf8/0x130 Code: 20 ca 66 84 e8 79 0c 00 00 b8 ff ff ff ff 65 0f c1 05 14 71 e9 7b 83 f8 01 75 22 48 f7 04 24 00 02 00 00 74 01 fb 48 83 c4 08 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ed eb c0 0f 0b 48 RSP: 0018:ffff888043167588 EFLAGS: 00000286 RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffffff852886d0 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000001 R12: ffff888017dc0000 R13: 0000000000000001 R14: 00000000ffffffff R15: ffff888017dc09a0 shrinker_info_protected+0x20/0x110 do_shrink_slab+0x8df/0xb00 shrink_slab+0x3d7/0x6e0 shrink_node+0x892/0x1d10 do_try_to_free_pages+0x3c7/0x1670 try_to_free_mem_cgroup_pages+0x304/0x880 try_charge_memcg+0x4c2/0x13c0 mem_cgroup_charge_skmem+0x7c/0x1b0 RIP: 0010:kernfs_put.part.0+0x433/0x540 sock_setsockopt+0x203e/0x3490 Code: 03 80 3c 18 00 0f 85 ea 00 00 00 4d 8b 7d 38 e8 73 0a a7 ff 48 8b 14 24 44 89 f1 4c 89 fe 48 c7 c7 20 58 72 84 e8 7e 40 6c 02 <0f> 0b e9 b9 fc ff ff 48 89 ef e8 fe bb d9 ff e9 c1 fd ff ff e8 f4 RSP: 0018:ffff888009b57bd8 EFLAGS: 00010286 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 RDX: ffff8880097b5040 RSI: ffffffff812b68e8 RDI: ffffed100136af6d RBP: ffff88800ee04c00 R08: 0000000000000005 R09: 0000000000000000 __sys_setsockopt+0x258/0x2a0 R10: 0000000080000000 R11: 0000000000000001 R12: ffff88800ee04bc8 R13: ffff888015d263a0 R14: 0000000000000000 R15: ffff888008cd1528 __x64_sys_setsockopt+0xba/0x150 FS: 0000000000000000(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 do_syscall_64+0x3b/0x90 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 entry_SYSCALL_64_after_hwframe+0x46/0xb0 CR2: 0000001b2da26000 CR3: 0000000017c14000 CR4: 0000000000350ee0 RIP: 0033:0x7f26182cdb19 Call Trace: 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:00007f2615843188 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f26183e0f60 RCX: 00007f26182cdb19 RDX: 0000000000000049 RSI: 0000000000000001 RDI: 0000000000000008 RBP: 00007f2618327f6d R08: 0000000000000010 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000000000 kernfs_put+0x42/0x50 R13: 00007ffff2ef400f R14: 00007f2615843300 R15: 0000000000022000 kernfs_notify_workfn+0x417/0x560 irq event stamp: 8029 hardirqs last enabled at (8028): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 hardirqs last disabled at (8029): [] _raw_spin_lock_irqsave+0x4e/0x50 softirqs last enabled at (7858): [] __irq_exit_rcu+0x113/0x170 softirqs last disabled at (8017): [] __irq_exit_rcu+0x113/0x170 process_one_work+0xa17/0x1690 ---[ end trace 0000000000000000 ]--- worker_thread+0x637/0x1250 kthread+0x2f2/0x3b0 ret_from_fork+0x22/0x30 irq event stamp: 368113 hardirqs last enabled at (368123): [] __up_console_sem+0x78/0x80 hardirqs last disabled at (368134): [] __up_console_sem+0x5d/0x80 softirqs last enabled at (367298): [] __irq_exit_rcu+0x113/0x170 softirqs last disabled at (367277): [] __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 ffff88800ee04c48 by task kworker/1:1/35 CPU: 1 PID: 35 Comm: kworker/1:1 Tainted: G W 5.19.0-rc4-next-20220630 #1 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: dump_stack_lvl+0x8b/0xb3 print_report.cold+0x5e/0x5e1 kasan_report+0xbe/0x1c0 llist_del_first+0x89/0xa0 kernfs_notify_workfn+0x78/0x560 process_one_work+0xa17/0x1690 ------------[ cut here ]------------ worker_thread+0x637/0x1250 WARNING: CPU: 0 PID: 4876 at fs/kernfs/dir.c:504 kernfs_get.part.0+0x69/0x80 Modules linked in: kthread+0x2f2/0x3b0 CPU: 0 PID: 4876 Comm: syz-executor.2 Tainted: G W 5.19.0-rc4-next-20220630 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 ret_from_fork+0x22/0x30 RIP: 0010:kernfs_get.part.0+0x69/0x80 Code: 31 ff 89 ee e8 c8 0b a7 ff 85 ed 74 18 e8 ef 0e a7 ff be 04 00 00 00 48 89 df e8 c2 c3 d9 ff f0 ff 03 5b 5d c3 e8 d7 0e a7 ff <0f> 0b eb df 48 89 df e8 6b c0 d9 ff eb c6 66 0f 1f 84 00 00 00 00 RSP: 0018:ffff88801815fa60 EFLAGS: 00010012 Allocated by task 299: RAX: 000000000001eb1a RBX: ffff88800ee04bc8 RCX: ffffc900017eb000 kasan_save_stack+0x1e/0x40 RDX: 0000000000040000 RSI: ffffffff819d50a9 RDI: 0000000000000005 __kasan_slab_alloc+0x66/0x80 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 kmem_cache_alloc+0x1b1/0x490 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 __kernfs_new_node+0xd4/0x8b0 R13: 1ffffffff0a01e40 R14: ffff88800ee04bc8 R15: ffff88801716c490 kernfs_new_node+0x93/0x120 FS: 00007f7f462c4700(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000 __kernfs_create_file+0x51/0x350 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 cgroup_addrm_files+0x3e2/0x9d0 CR2: 00007f8a7dfef008 CR3: 000000000d564000 CR4: 0000000000350ef0 css_populate_dir+0x19b/0x450 Call Trace: cgroup_apply_control_enable+0x3ae/0xa40 cgroup_mkdir+0x824/0x11f0 kernfs_get+0x1b/0x30 kernfs_iop_mkdir+0x149/0x1d0 kernfs_notify+0x180/0x350 vfs_mkdir+0x417/0x6a0 cgroup_file_notify+0xf5/0x1a0 do_mkdirat+0x17b/0x2e0 try_charge_memcg+0x461/0x13c0 __x64_sys_mkdir+0xf2/0x140 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 35: kasan_save_stack+0x1e/0x40 mem_cgroup_charge_skmem+0x7c/0x1b0 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 ____kasan_slab_free+0x14b/0x1a0 kmem_cache_free+0xfb/0x600 sock_setsockopt+0x203e/0x3490 kernfs_put.part.0+0x2c7/0x540 kernfs_put+0x42/0x50 kernfs_notify_workfn+0x417/0x560 process_one_work+0xa17/0x1690 worker_thread+0x637/0x1250 kthread+0x2f2/0x3b0 __sys_setsockopt+0x258/0x2a0 ret_from_fork+0x22/0x30 The buggy address belongs to the object at ffff88800ee04bc8 which belongs to the cache kernfs_node_cache of size 168 __x64_sys_setsockopt+0xba/0x150 The buggy address is located 128 bytes inside of 168-byte region [ffff88800ee04bc8, ffff88800ee04c70) do_syscall_64+0x3b/0x90 The buggy address belongs to the physical page: entry_SYSCALL_64_after_hwframe+0x46/0xb0 page:00000000b376ee23 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xee04 RIP: 0033:0x7f7f48d4eb19 flags: 0x100000000000200(slab|node=0|zone=1) 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 raw: 0100000000000200 0000000000000000 dead000000000122 ffff8880080718c0 RSP: 002b:00007f7f462c4188 EFLAGS: 00000246 raw: 0000000000000000 0000000000110011 00000001ffffffff 0000000000000000 ORIG_RAX: 0000000000000036 page dumped because: kasan: bad access detected RAX: ffffffffffffffda RBX: 00007f7f48e61f60 RCX: 00007f7f48d4eb19 RDX: 0000000000000049 RSI: 0000000000000001 RDI: 0000000000000008 Memory state around the buggy address: RBP: 00007f7f48da8f6d R08: 0000000000000010 R09: 0000000000000000 ffff88800ee04b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000000000 ffff88800ee04b80: 00 fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb R13: 00007fff8f14137f R14: 00007f7f462c4300 R15: 0000000000022000 >ffff88800ee04c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ^ irq event stamp: 7354 ffff88800ee04c80: fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 hardirqs last enabled at (7353): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 ffff88800ee04d00: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc hardirqs last disabled at (7354): [] _raw_spin_lock_irqsave+0x4e/0x50 ================================================================== softirqs last enabled at (3882): [] __irq_exit_rcu+0x113/0x170 softirqs last disabled at (3857): [] __irq_exit_rcu+0x113/0x170 ---[ end trace 0000000000000000 ]--- netlink: 2552 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 2552 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 2552 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 2552 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 2552 bytes leftover after parsing attributes in process `syz-executor.7'. ---------------- Code disassembly (best guess): 0: 20 ca and %cl,%dl 2: 66 84 e8 data16 test %ch,%al 5: 79 0c jns 0x13 7: 00 00 add %al,(%rax) 9: b8 ff ff ff ff mov $0xffffffff,%eax e: 65 0f c1 05 14 71 e9 xadd %eax,%gs:0x7be97114(%rip) # 0x7be9712a 15: 7b 16: 83 f8 01 cmp $0x1,%eax 19: 75 22 jne 0x3d 1b: 48 f7 04 24 00 02 00 testq $0x200,(%rsp) 22: 00 23: 74 01 je 0x26 25: fb sti 26: 48 83 c4 08 add $0x8,%rsp * 2a: 44 89 e8 mov %r13d,%eax <-- trapping instruction 2d: 5b pop %rbx 2e: 5d pop %rbp 2f: 41 5c pop %r12 31: 41 5d pop %r13 33: 41 5e pop %r14 35: 41 5f pop %r15 37: c3 retq 38: 45 31 ed xor %r13d,%r13d 3b: eb c0 jmp 0xfffffffd 3d: 0f 0b ud2 3f: 48 rex.W