------------[ cut here ]------------
======================================================
WARNING: possible circular locking dependency detected
6.7.0-rc2-next-20231123-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/19030 is trying to acquire lock:
ffffffff8cf9aab8 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0x12/0x70 kernel/locking/semaphore.c:139
but task is already holding lock:
ffffffff8da74558 (pool_rwlock){----}-{2:2}, at: stack_depot_put lib/stackdepot.c:621 [inline]
ffffffff8da74558 (pool_rwlock){----}-{2:2}, at: stack_depot_put+0x24/0x110 lib/stackdepot.c:613
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (pool_rwlock){----}-{2:2}:
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
_raw_read_lock_irqsave+0x46/0x90 kernel/locking/spinlock.c:236
stack_depot_save_flags+0x169/0x740 lib/stackdepot.c:508
kasan_save_stack+0x42/0x50 mm/kasan/common.c:47
__kasan_record_aux_stack+0xc2/0xd0 mm/kasan/generic.c:508
task_work_add+0x88/0x2a0 kernel/task_work.c:48
task_tick_numa kernel/sched/fair.c:3512 [inline]
task_tick_fair+0x5a5/0xc30 kernel/sched/fair.c:12570
scheduler_tick+0x210/0x650 kernel/sched/core.c:5674
update_process_times+0x19e/0x220 kernel/time/timer.c:2076
tick_sched_handle+0x8e/0x170 kernel/time/tick-sched.c:255
tick_nohz_highres_handler+0xe9/0x110 kernel/time/tick-sched.c:1516
__run_hrtimer kernel/time/hrtimer.c:1688 [inline]
__hrtimer_run_queues+0x654/0xc20 kernel/time/hrtimer.c:1752
hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline]
__sysvec_apic_timer_interrupt+0x10c/0x410 arch/x86/kernel/apic/apic.c:1082
sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1076
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
__read_once_word_nocheck+0x0/0x10
deref_stack_reg arch/x86/kernel/unwind_orc.c:406 [inline]
unwind_next_frame+0x1ab8/0x2390 arch/x86/kernel/unwind_orc.c:648
arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122
kasan_save_stack+0x33/0x50 mm/kasan/common.c:46
kasan_set_track+0x24/0x30 mm/kasan/common.c:53
__kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:330
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:763 [inline]
slab_alloc_node mm/slub.c:3452 [inline]
slab_alloc mm/slub.c:3460 [inline]
__kmem_cache_alloc_lru mm/slub.c:3467 [inline]
kmem_cache_alloc+0x163/0x300 mm/slub.c:3476
mt_alloc_one lib/maple_tree.c:162 [inline]
mas_alloc_nodes+0x176/0x860 lib/maple_tree.c:1242
mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1322
mas_preallocate+0x3bb/0xee0 lib/maple_tree.c:5487
vma_iter_prealloc mm/internal.h:1147 [inline]
vma_link+0x120/0x5d0 mm/mmap.c:401
insert_vm_struct+0x1e3/0x450 mm/mmap.c:3346
__install_special_mapping+0x165/0x390 mm/mmap.c:3590
map_vdso+0x17c/0x490 arch/x86/entry/vdso/vma.c:257
load_elf_binary+0x1f04/0x4e10 fs/binfmt_elf.c:1237
search_binary_handler fs/exec.c:1736 [inline]
exec_binprm fs/exec.c:1778 [inline]
bprm_execve fs/exec.c:1853 [inline]
bprm_execve+0x7ef/0x1a80 fs/exec.c:1809
kernel_execve+0x3d7/0x4e0 fs/exec.c:2021
try_to_run_init_process init/main.c:1364 [inline]
kernel_init+0x137/0x2a0 init/main.c:1497
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
-> #2 (&rq->__lock){-.-.}-{2:2}:
_raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378
raw_spin_rq_lock_nested+0x29/0x130 kernel/sched/core.c:558
raw_spin_rq_lock kernel/sched/sched.h:1374 [inline]
rq_lock kernel/sched/sched.h:1688 [inline]
task_fork_fair+0x70/0x240 kernel/sched/fair.c:12590
sched_cgroup_fork+0x3cf/0x510 kernel/sched/core.c:4835
copy_process+0x6a38/0x9770 kernel/fork.c:2601
kernel_clone+0xfd/0x940 kernel/fork.c:2899
user_mode_thread+0xb4/0xf0 kernel/fork.c:2977
rest_init+0x27/0x2b0 init/main.c:695
arch_call_rest_init+0x13/0x30 init/main.c:827
start_kernel+0x39e/0x480 init/main.c:1072
x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:555
x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:536
secondary_startup_64_no_verify+0x166/0x16b
-> #1 (&p->pi_lock){-.-.}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162
class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:522 [inline]
try_to_wake_up+0x9a/0x13d0 kernel/sched/core.c:4252
up+0x79/0xb0 kernel/locking/semaphore.c:191
__up_console_sem kernel/printk/printk.c:340 [inline]
__console_unlock kernel/printk/printk.c:2706 [inline]
console_unlock+0x1cf/0x260 kernel/printk/printk.c:3038
vprintk_emit+0x17f/0x5f0 kernel/printk/printk.c:2303
vprintk+0x7b/0x90 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2328
validate_nla lib/nlattr.c:410 [inline]
__nla_validate_parse+0x1854/0x2850 lib/nlattr.c:631
__nla_parse+0x40/0x50 lib/nlattr.c:728
__nlmsg_parse include/net/netlink.h:756 [inline]
nlmsg_parse_deprecated include/net/netlink.h:797 [inline]
rtnl_setlink+0x15b/0x3e0 net/core/rtnetlink.c:3185
rtnetlink_rcv_msg+0x3c7/0xe00 net/core/rtnetlink.c:6558
netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2544
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8b4/0xd70 net/netlink/af_netlink.c:1909
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0xd5/0x180 net/socket.c:745
sock_write_iter+0x29b/0x3d0 net/socket.c:1158
call_write_iter include/linux/fs.h:2021 [inline]
do_iter_readv_writev+0x21d/0x3c0 fs/read_write.c:735
do_iter_write+0x17f/0x7f0 fs/read_write.c:860
vfs_writev+0x221/0x700 fs/read_write.c:933
do_writev+0x283/0x370 fs/read_write.c:976
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x62/0x6a
-> #0 ((console_sem).lock){-.-.}-{2:2}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x2466/0x3b10 kernel/locking/lockdep.c:5136
lock_acquire kernel/locking/lockdep.c:5753 [inline]
lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162
down_trylock+0x12/0x70 kernel/locking/semaphore.c:139
__down_trylock_console_sem+0x40/0x140 kernel/printk/printk.c:323
console_trylock+0x73/0x130 kernel/printk/printk.c:2659
console_trylock_spinning kernel/printk/printk.c:1923 [inline]
vprintk_emit+0x162/0x5f0 kernel/printk/printk.c:2302
vprintk+0x7b/0x90 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2328
__warn_printk+0x158/0x350 kernel/panic.c:721
refcount_warn_saturate+0x149/0x210 lib/refcount.c:28
__refcount_sub_and_test include/linux/refcount.h:283 [inline]
__refcount_dec_and_test include/linux/refcount.h:315 [inline]
refcount_dec_and_test include/linux/refcount.h:333 [inline]
stack_depot_put lib/stackdepot.c:627 [inline]
stack_depot_put+0xe4/0x110 lib/stackdepot.c:613
__kasan_record_aux_stack+0xb3/0xd0 mm/kasan/generic.c:506
insert_work+0x38/0x230 kernel/workqueue.c:1653
__queue_work+0x633/0x11d0 kernel/workqueue.c:1802
__queue_delayed_work+0x1bf/0x270 kernel/workqueue.c:1953
mod_delayed_work_on+0xcc/0x1a0 kernel/workqueue.c:2027
kblockd_mod_delayed_work_on+0x29/0x40 block/blk-core.c:1038
blk_kick_flush block/blk-flush.c:348 [inline]
blk_flush_complete_seq+0xa66/0x10c0 block/blk-flush.c:213
mq_flush_data_end_io+0x2e3/0x580 block/blk-flush.c:376
__blk_mq_end_request+0x202/0x4a0 block/blk-mq.c:1046
scsi_end_request+0x444/0x9a0 drivers/scsi/scsi_lib.c:572
scsi_io_completion+0x178/0x14a0 drivers/scsi/scsi_lib.c:975
scsi_complete+0x124/0x250 drivers/scsi/scsi_lib.c:1437
blk_complete_reqs+0xb2/0xf0 block/blk-mq.c:1131
__do_softirq+0x216/0x8d5 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0xb5/0x120 kernel/softirq.c:644
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:247
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636
count_memcg_events include/linux/memcontrol.h:1087 [inline]
count_memcg_event_mm.part.0+0xfc/0x340 include/linux/memcontrol.h:1110
count_memcg_event_mm include/linux/memcontrol.h:573 [inline]
mm_account_fault mm/memory.c:5221 [inline]
handle_mm_fault+0x1b8/0xa00 mm/memory.c:5368
faultin_page mm/gup.c:956 [inline]
__get_user_pages+0x4b1/0x1490 mm/gup.c:1239
__get_user_pages_locked mm/gup.c:1507 [inline]
__gup_longterm_locked+0x278/0x2ab0 mm/gup.c:2209
internal_get_user_pages_fast+0x1b3c/0x2d40 mm/gup.c:3213
pin_user_pages_fast+0xa8/0xf0 mm/gup.c:3319
iov_iter_extract_user_pages lib/iov_iter.c:1617 [inline]
iov_iter_extract_pages+0x388/0x1750 lib/iov_iter.c:1680
__bio_iov_iter_get_pages block/bio.c:1255 [inline]
bio_iov_iter_get_pages+0x344/0xe40 block/bio.c:1333
iomap_dio_bio_iter+0xc44/0x1710 fs/iomap/direct-io.c:387
iomap_dio_iter fs/iomap/direct-io.c:500 [inline]
__iomap_dio_rw+0xda0/0x1c00 fs/iomap/direct-io.c:659
iomap_dio_rw+0x40/0xa0 fs/iomap/direct-io.c:748
ext4_dio_write_iter fs/ext4/file.c:575 [inline]
ext4_file_write_iter+0x12c2/0x1950 fs/ext4/file.c:694
call_write_iter include/linux/fs.h:2021 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x64d/0xdf0 fs/read_write.c:584
ksys_write+0x12f/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x62/0x6a
other info that might help us debug this:
Chain exists of:
(console_sem).lock --> &rq->__lock --> pool_rwlock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(pool_rwlock);
lock(&rq->__lock);
lock(pool_rwlock);
lock((console_sem).lock);
*** DEADLOCK ***
9 locks held by syz-executor.1/19030:
#0: ffff88803d584fc8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe7/0x170 fs/file.c:1177
#1: ffff88814d0c2420 (sb_writers#4){.+.+}-{0:0}, at: ksys_write+0x12f/0x250 fs/read_write.c:637
#2: ffff8880797bb600 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline]
#2: ffff8880797bb600 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_dio_write_iter fs/ext4/file.c:528 [inline]
#2: ffff8880797bb600 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_file_write_iter+0xc87/0x1950 fs/ext4/file.c:694
#3: ffff888028fb0b20 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock_killable include/linux/mmap_lock.h:155 [inline]
#3: ffff888028fb0b20 (&mm->mmap_lock){++++}-{3:3}, at: __get_user_pages_locked mm/gup.c:1482 [inline]
#3: ffff888028fb0b20 (&mm->mmap_lock){++++}-{3:3}, at: __gup_longterm_locked+0x9f3/0x2ab0 mm/gup.c:2209
#4: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline]
#4: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline]
#4: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: count_memcg_event_mm.part.0+0x31/0x340 include/linux/memcontrol.h:1107
#5: ffff88801e529318 (&fq->mq_flush_lock){..-.}-{2:2}, at: mq_flush_data_end_io+0x25c/0x580 block/blk-flush.c:369
#6: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline]
#6: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline]
#6: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: __queue_work+0xf2/0x11d0 kernel/workqueue.c:1730
#7: ffff8880b993c2f8 (&pool->lock){-.-.}-{2:2}, at: __queue_work+0x39e/0x11d0 kernel/workqueue.c:1766
#8: ffffffff8da74558 (pool_rwlock){----}-{2:2}, at: stack_depot_put lib/stackdepot.c:621 [inline]
#8: ffffffff8da74558 (pool_rwlock){----}-{2:2}, at: stack_depot_put+0x24/0x110 lib/stackdepot.c:613
stack backtrace:
CPU: 1 PID: 19030 Comm: syz-executor.1 Not tainted 6.7.0-rc2-next-20231123-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
check_noncircular+0x316/0x400 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x2466/0x3b10 kernel/locking/lockdep.c:5136
lock_acquire kernel/locking/lockdep.c:5753 [inline]
lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162
down_trylock+0x12/0x70 kernel/locking/semaphore.c:139
__down_trylock_console_sem+0x40/0x140 kernel/printk/printk.c:323
console_trylock+0x73/0x130 kernel/printk/printk.c:2659
console_trylock_spinning kernel/printk/printk.c:1923 [inline]
vprintk_emit+0x162/0x5f0 kernel/printk/printk.c:2302
vprintk+0x7b/0x90 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2328
__warn_printk+0x158/0x350 kernel/panic.c:721
refcount_warn_saturate+0x149/0x210 lib/refcount.c:28
__refcount_sub_and_test include/linux/refcount.h:283 [inline]
__refcount_dec_and_test include/linux/refcount.h:315 [inline]
refcount_dec_and_test include/linux/refcount.h:333 [inline]
stack_depot_put lib/stackdepot.c:627 [inline]
stack_depot_put+0xe4/0x110 lib/stackdepot.c:613
__kasan_record_aux_stack+0xb3/0xd0 mm/kasan/generic.c:506
insert_work+0x38/0x230 kernel/workqueue.c:1653
__queue_work+0x633/0x11d0 kernel/workqueue.c:1802
__queue_delayed_work+0x1bf/0x270 kernel/workqueue.c:1953
mod_delayed_work_on+0xcc/0x1a0 kernel/workqueue.c:2027
kblockd_mod_delayed_work_on+0x29/0x40 block/blk-core.c:1038
blk_kick_flush block/blk-flush.c:348 [inline]
blk_flush_complete_seq+0xa66/0x10c0 block/blk-flush.c:213
mq_flush_data_end_io+0x2e3/0x580 block/blk-flush.c:376
__blk_mq_end_request+0x202/0x4a0 block/blk-mq.c:1046
scsi_end_request+0x444/0x9a0 drivers/scsi/scsi_lib.c:572
scsi_io_completion+0x178/0x14a0 drivers/scsi/scsi_lib.c:975
scsi_complete+0x124/0x250 drivers/scsi/scsi_lib.c:1437
blk_complete_reqs+0xb2/0xf0 block/blk-mq.c:1131
__do_softirq+0x216/0x8d5 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0xb5/0x120 kernel/softirq.c:644
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:247
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636
RIP: 0010:rcu_read_unlock include/linux/rcupdate.h:776 [inline]
RIP: 0010:count_memcg_event_mm.part.0+0xfc/0x340 include/linux/memcontrol.h:1111
Code: 01 00 00 00 44 89 e6 48 89 df e8 af c1 1d 00 9c 5b 81 e3 00 02 00 00 31 ff 48 89 de e8 7d 28 bf ff 48 85 db 0f 85 21 02 00 00 df 2c bf ff e8 0a 21 bc 08 31 ff 89 c3 89 c6 e8 3f 28 bf ff 85
RSP: 0018:ffffc90004a270e8 EFLAGS: 00000246
RAX: 0000000000040000 RBX: 0000000000000000 RCX: ffffc9001b002000
RDX: 0000000000040000 RSI: ffffffff81c8e347 RDI: 0000000000000007
RBP: 0000000000000200 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000004 R12: 0000000000000017
R13: 0000000000000000 R14: ffff888039f71110 R15: 0000000000000000
count_memcg_event_mm include/linux/memcontrol.h:573 [inline]
mm_account_fault mm/memory.c:5221 [inline]
handle_mm_fault+0x1b8/0xa00 mm/memory.c:5368
faultin_page mm/gup.c:956 [inline]
__get_user_pages+0x4b1/0x1490 mm/gup.c:1239
__get_user_pages_locked mm/gup.c:1507 [inline]
__gup_longterm_locked+0x278/0x2ab0 mm/gup.c:2209
internal_get_user_pages_fast+0x1b3c/0x2d40 mm/gup.c:3213
pin_user_pages_fast+0xa8/0xf0 mm/gup.c:3319
iov_iter_extract_user_pages lib/iov_iter.c:1617 [inline]
iov_iter_extract_pages+0x388/0x1750 lib/iov_iter.c:1680
__bio_iov_iter_get_pages block/bio.c:1255 [inline]
bio_iov_iter_get_pages+0x344/0xe40 block/bio.c:1333
iomap_dio_bio_iter+0xc44/0x1710 fs/iomap/direct-io.c:387
iomap_dio_iter fs/iomap/direct-io.c:500 [inline]
__iomap_dio_rw+0xda0/0x1c00 fs/iomap/direct-io.c:659
iomap_dio_rw+0x40/0xa0 fs/iomap/direct-io.c:748
ext4_dio_write_iter fs/ext4/file.c:575 [inline]
ext4_file_write_iter+0x12c2/0x1950 fs/ext4/file.c:694
call_write_iter include/linux/fs.h:2021 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x64d/0xdf0 fs/read_write.c:584
ksys_write+0x12f/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x62/0x6a
RIP: 0033:0x7f0a94c7cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0a95aad0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f0a94d9bf80 RCX: 00007f0a94c7cae9
RDX: 0000000000248800 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007f0a94cc847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f0a94d9bf80 R15: 00007ffcac341608
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 19030 at lib/refcount.c:28 refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 19030 Comm: syz-executor.1 Not tainted 6.7.0-rc2-next-20231123-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28
Code: ff 89 de e8 38 3d 24 fd 84 db 0f 85 66 ff ff ff e8 fb 41 24 fd c6 05 e0 a9 9f 0a 01 90 48 c7 c7 a0 c5 2e 8b e8 f7 37 ea fc 90 <0f> 0b 90 90 e9 43 ff ff ff e8 d8 41 24 fd 0f b6 1d bb a9 9f 0a 31
RSP: 0018:ffffc900001f0aa0 EFLAGS: 00010082
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff814e05d9
RDX: ffff88802fe09dc0 RSI: ffffffff814e05e6 RDI: 0000000000000001
RBP: ffff88808bd1bb9c R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffff888142ee8000
R13: ffff8880130a6800 R14: ffff8880130a685c R15: ffff8880b993c340
FS: 00007f0a95aad6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f011e55cd58 CR3: 0000000020c39000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__refcount_sub_and_test include/linux/refcount.h:283 [inline]
__refcount_dec_and_test include/linux/refcount.h:315 [inline]
refcount_dec_and_test include/linux/refcount.h:333 [inline]
stack_depot_put lib/stackdepot.c:627 [inline]
stack_depot_put+0xe4/0x110 lib/stackdepot.c:613
__kasan_record_aux_stack+0xb3/0xd0 mm/kasan/generic.c:506
insert_work+0x38/0x230 kernel/workqueue.c:1653
__queue_work+0x633/0x11d0 kernel/workqueue.c:1802
__queue_delayed_work+0x1bf/0x270 kernel/workqueue.c:1953
mod_delayed_work_on+0xcc/0x1a0 kernel/workqueue.c:2027
kblockd_mod_delayed_work_on+0x29/0x40 block/blk-core.c:1038
blk_kick_flush block/blk-flush.c:348 [inline]
blk_flush_complete_seq+0xa66/0x10c0 block/blk-flush.c:213
mq_flush_data_end_io+0x2e3/0x580 block/blk-flush.c:376
__blk_mq_end_request+0x202/0x4a0 block/blk-mq.c:1046
scsi_end_request+0x444/0x9a0 drivers/scsi/scsi_lib.c:572
scsi_io_completion+0x178/0x14a0 drivers/scsi/scsi_lib.c:975
scsi_complete+0x124/0x250 drivers/scsi/scsi_lib.c:1437
blk_complete_reqs+0xb2/0xf0 block/blk-mq.c:1131
__do_softirq+0x216/0x8d5 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0xb5/0x120 kernel/softirq.c:644
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:247
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636
RIP: 0010:rcu_read_unlock include/linux/rcupdate.h:776 [inline]
RIP: 0010:count_memcg_event_mm.part.0+0xfc/0x340 include/linux/memcontrol.h:1111
Code: 01 00 00 00 44 89 e6 48 89 df e8 af c1 1d 00 9c 5b 81 e3 00 02 00 00 31 ff 48 89 de e8 7d 28 bf ff 48 85 db 0f 85 21 02 00 00 df 2c bf ff e8 0a 21 bc 08 31 ff 89 c3 89 c6 e8 3f 28 bf ff 85
RSP: 0018:ffffc90004a270e8 EFLAGS: 00000246
RAX: 0000000000040000 RBX: 0000000000000000 RCX: ffffc9001b002000
RDX: 0000000000040000 RSI: ffffffff81c8e347 RDI: 0000000000000007
RBP: 0000000000000200 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000004 R12: 0000000000000017
R13: 0000000000000000 R14: ffff888039f71110 R15: 0000000000000000
count_memcg_event_mm include/linux/memcontrol.h:573 [inline]
mm_account_fault mm/memory.c:5221 [inline]
handle_mm_fault+0x1b8/0xa00 mm/memory.c:5368
faultin_page mm/gup.c:956 [inline]
__get_user_pages+0x4b1/0x1490 mm/gup.c:1239
__get_user_pages_locked mm/gup.c:1507 [inline]
__gup_longterm_locked+0x278/0x2ab0 mm/gup.c:2209
internal_get_user_pages_fast+0x1b3c/0x2d40 mm/gup.c:3213
pin_user_pages_fast+0xa8/0xf0 mm/gup.c:3319
iov_iter_extract_user_pages lib/iov_iter.c:1617 [inline]
iov_iter_extract_pages+0x388/0x1750 lib/iov_iter.c:1680
__bio_iov_iter_get_pages block/bio.c:1255 [inline]
bio_iov_iter_get_pages+0x344/0xe40 block/bio.c:1333
iomap_dio_bio_iter+0xc44/0x1710 fs/iomap/direct-io.c:387
iomap_dio_iter fs/iomap/direct-io.c:500 [inline]
__iomap_dio_rw+0xda0/0x1c00 fs/iomap/direct-io.c:659
iomap_dio_rw+0x40/0xa0 fs/iomap/direct-io.c:748
ext4_dio_write_iter fs/ext4/file.c:575 [inline]
ext4_file_write_iter+0x12c2/0x1950 fs/ext4/file.c:694
call_write_iter include/linux/fs.h:2021 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x64d/0xdf0 fs/read_write.c:584
ksys_write+0x12f/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x62/0x6a
RIP: 0033:0x7f0a94c7cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0a95aad0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f0a94d9bf80 RCX: 00007f0a94c7cae9
RDX: 0000000000248800 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007f0a94cc847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f0a94d9bf80 R15: 00007ffcac341608
----------------
Code disassembly (best guess):
0: 01 00 add %eax,(%rax)
2: 00 00 add %al,(%rax)
4: 44 89 e6 mov %r12d,%esi
7: 48 89 df mov %rbx,%rdi
a: e8 af c1 1d 00 call 0x1dc1be
f: 9c pushf
10: 5b pop %rbx
11: 81 e3 00 02 00 00 and $0x200,%ebx
17: 31 ff xor %edi,%edi
19: 48 89 de mov %rbx,%rsi
1c: e8 7d 28 bf ff call 0xffbf289e
21: 48 85 db test %rbx,%rbx
24: 0f 85 21 02 00 00 jne 0x24b
* 2a: e8 df 2c bf ff call 0xffbf2d0e <-- trapping instruction
2f: e8 0a 21 bc 08 call 0x8bc213e
34: 31 ff xor %edi,%edi
36: 89 c3 mov %eax,%ebx
38: 89 c6 mov %eax,%esi
3a: e8 3f 28 bf ff call 0xffbf287e
3f: 85 .byte 0x85