BUG: sleeping function called from invalid context at kernel/locking/mutex.c:580
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 22451, name: syz-executor.3
preempt_count: 101, expected: 0
RCU nest depth: 1, expected: 0
4 locks held by syz-executor.3/22451:
#0: ffff88807da349d8 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline]
#0: ffff88807da349d8 (&mm->mmap_lock#2){++++}-{3:3}, at: exit_mmap+0xe8/0x7a0 mm/mmap.c:3079
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1420 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1577 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1606 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1627 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0xa03/0x3c90 mm/memory.c:1648
#2: ffffffff8bf88980 (rcu_read_lock){....}-{1:2}, at: folio_memcg_lock+0x0/0x630 include/linux/cgroup.h:590
#3: ffffc900001e0d60 ((&dlci->t1)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:31 [inline]
#3: ffffc900001e0d60 ((&dlci->t1)){+.-.}-{0:0}, at: call_timer_fn+0xd4/0x7c0 kernel/time/timer.c:1464
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 22451 Comm: syz-executor.3 Not tainted 6.1.0-rc5-syzkaller-00008-ge01d50cbd6ee #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
__might_resched.cold+0x222/0x26b kernel/sched/core.c:9890
__mutex_lock_common kernel/locking/mutex.c:580 [inline]
__mutex_lock+0x9f/0x1350 kernel/locking/mutex.c:747
gsm_send.isra.0+0x41e/0x7e0 drivers/tty/n_gsm.c:724
gsm_command drivers/tty/n_gsm.c:788 [inline]
gsm_dlci_begin_close+0x12e/0x210 drivers/tty/n_gsm.c:1930
gsm_dlci_t1+0x186/0x450 drivers/tty/n_gsm.c:1854
call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers.part.0+0x6a2/0xaf0 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803
__do_softirq+0x1f7/0xad8 kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1107
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:lock_acquire+0x223/0x630 kernel/locking/lockdep.c:5636
Code: ae a2 7e 83 f8 01 0f 85 3a 03 00 00 9c 58 f6 c4 02 0f 85 25 03 00 00 48 83 7c 24 08 00 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24
RSP: 0018:ffffc900078b74e8 EFLAGS: 00000206
RAX: dffffc0000000000 RBX: 1ffff92000f16ea0 RCX: 982e573b2c47e428
RDX: 1ffff11011bab149 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff90932947
R10: fffffbfff2126528 R11: 0000000000000001 R12: 0000000000000002
R13: 0000000000000000 R14: ffffffff8bf88980 R15: 0000000000000000
rcu_lock_acquire include/linux/rcupdate.h:304 [inline]
rcu_read_lock include/linux/rcupdate.h:738 [inline]
folio_memcg_lock+0x3a/0x630 mm/memcontrol.c:2098
page_remove_rmap+0x27/0x1110 mm/rmap.c:1426
zap_pte_range mm/memory.c:1456 [inline]
zap_pmd_range mm/memory.c:1577 [inline]
zap_pud_range mm/memory.c:1606 [inline]
zap_p4d_range mm/memory.c:1627 [inline]
unmap_page_range+0x11ee/0x3c90 mm/memory.c:1648
unmap_single_vma+0x190/0x2a0 mm/memory.c:1694
unmap_vmas+0x21e/0x370 mm/memory.c:1733
exit_mmap+0x189/0x7a0 mm/mmap.c:3094
__mmput+0x128/0x4c0 kernel/fork.c:1185
mmput+0x5c/0x70 kernel/fork.c:1207
exit_mm kernel/exit.c:516 [inline]
do_exit+0xa39/0x2a20 kernel/exit.c:807
do_group_exit+0xd0/0x2a0 kernel/exit.c:950
get_signal+0x21a1/0x2430 kernel/signal.c:2858
arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869
exit_to_user_mode_loop kernel/entry/common.c:168 [inline]
exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:296
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fe055e8b639
Code: Unable to access opcode bytes at 0x7fe055e8b60f.
RSP: 002b:00007fe056be4218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007fe055fabf88 RCX: 00007fe055e8b639
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe055fabf88
RBP: 00007fe055fabf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe055fabf8c
R13: 00007ffdb4df364f R14: 00007fe056be4300 R15: 0000000000022000
=============================
[ BUG: Invalid wait context ]
6.1.0-rc5-syzkaller-00008-ge01d50cbd6ee #0 Tainted: G W
-----------------------------
syz-executor.3/22451 is trying to lock:
ffff88803fa30430 (&gsm->tx_mutex){+.+.}-{3:3}, at: gsm_send.isra.0+0x41e/0x7e0 drivers/tty/n_gsm.c:724
other info that might help us debug this:
context-{2:2}
4 locks held by syz-executor.3/22451:
#0: ffff88807da349d8 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline]
#0: ffff88807da349d8 (&mm->mmap_lock#2){++++}-{3:3}, at: exit_mmap+0xe8/0x7a0 mm/mmap.c:3079
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1420 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1577 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1606 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1627 [inline]
#1: ffff88806acf4258 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0xa03/0x3c90 mm/memory.c:1648
#2: ffffffff8bf88980 (rcu_read_lock){....}-{1:2}, at: folio_memcg_lock+0x0/0x630 include/linux/cgroup.h:590
#3: ffffc900001e0d60 ((&dlci->t1)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:31 [inline]
#3: ffffc900001e0d60 ((&dlci->t1)){+.-.}-{0:0}, at: call_timer_fn+0xd4/0x7c0 kernel/time/timer.c:1464
stack backtrace:
CPU: 1 PID: 22451 Comm: syz-executor.3 Tainted: G W 6.1.0-rc5-syzkaller-00008-ge01d50cbd6ee #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_lock_invalid_wait_context kernel/locking/lockdep.c:4707 [inline]
check_wait_context kernel/locking/lockdep.c:4768 [inline]
__lock_acquire.cold+0x322/0x3a7 kernel/locking/lockdep.c:5005
lock_acquire kernel/locking/lockdep.c:5668 [inline]
lock_acquire+0x1df/0x630 kernel/locking/lockdep.c:5633
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747
gsm_send.isra.0+0x41e/0x7e0 drivers/tty/n_gsm.c:724
gsm_command drivers/tty/n_gsm.c:788 [inline]
gsm_dlci_begin_close+0x12e/0x210 drivers/tty/n_gsm.c:1930
gsm_dlci_t1+0x186/0x450 drivers/tty/n_gsm.c:1854
call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers.part.0+0x6a2/0xaf0 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803
__do_softirq+0x1f7/0xad8 kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1107
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:lock_acquire+0x223/0x630 kernel/locking/lockdep.c:5636
Code: ae a2 7e 83 f8 01 0f 85 3a 03 00 00 9c 58 f6 c4 02 0f 85 25 03 00 00 48 83 7c 24 08 00 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24
RSP: 0018:ffffc900078b74e8 EFLAGS: 00000206
RAX: dffffc0000000000 RBX: 1ffff92000f16ea0 RCX: 982e573b2c47e428
RDX: 1ffff11011bab149 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff90932947
R10: fffffbfff2126528 R11: 0000000000000001 R12: 0000000000000002
R13: 0000000000000000 R14: ffffffff8bf88980 R15: 0000000000000000
rcu_lock_acquire include/linux/rcupdate.h:304 [inline]
rcu_read_lock include/linux/rcupdate.h:738 [inline]
folio_memcg_lock+0x3a/0x630 mm/memcontrol.c:2098
page_remove_rmap+0x27/0x1110 mm/rmap.c:1426
zap_pte_range mm/memory.c:1456 [inline]
zap_pmd_range mm/memory.c:1577 [inline]
zap_pud_range mm/memory.c:1606 [inline]
zap_p4d_range mm/memory.c:1627 [inline]
unmap_page_range+0x11ee/0x3c90 mm/memory.c:1648
unmap_single_vma+0x190/0x2a0 mm/memory.c:1694
unmap_vmas+0x21e/0x370 mm/memory.c:1733
exit_mmap+0x189/0x7a0 mm/mmap.c:3094
__mmput+0x128/0x4c0 kernel/fork.c:1185
mmput+0x5c/0x70 kernel/fork.c:1207
exit_mm kernel/exit.c:516 [inline]
do_exit+0xa39/0x2a20 kernel/exit.c:807
do_group_exit+0xd0/0x2a0 kernel/exit.c:950
get_signal+0x21a1/0x2430 kernel/signal.c:2858
arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869
exit_to_user_mode_loop kernel/entry/common.c:168 [inline]
exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:296
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fe055e8b639
Code: Unable to access opcode bytes at 0x7fe055e8b60f.
RSP: 002b:00007fe056be4218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007fe055fabf88 RCX: 00007fe055e8b639
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe055fabf88
RBP: 00007fe055fabf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe055fabf8c
R13: 00007ffdb4df364f R14: 00007fe056be4300 R15: 0000000000022000
----------------
Code disassembly (best guess):
0: ae scas %es:(%rdi),%al
1: a2 7e 83 f8 01 0f 85 movabs %al,0x33a850f01f8837e
8: 3a 03
a: 00 00 add %al,(%rax)
c: 9c pushfq
d: 58 pop %rax
e: f6 c4 02 test $0x2,%ah
11: 0f 85 25 03 00 00 jne 0x33c
17: 48 83 7c 24 08 00 cmpq $0x0,0x8(%rsp)
1d: 74 01 je 0x20
1f: fb sti
20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
27: fc ff df
* 2a: 48 01 c3 add %rax,%rbx <-- trapping instruction
2d: 48 c7 03 00 00 00 00 movq $0x0,(%rbx)
34: 48 c7 43 08 00 00 00 movq $0x0,0x8(%rbx)
3b: 00
3c: 48 rex.W
3d: 8b .byte 0x8b
3e: 84 .byte 0x84
3f: 24 .byte 0x24