[v6.1] possible deadlock in tty_port_default_wakeup

0 views
Skip to first unread message

syzbot

unread,
Mar 19, 2024, 6:08:19 PMMar 19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d7543167affd Linux 6.1.82
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10c8eaa5180000
kernel config: https://syzkaller.appspot.com/x/.config?x=59059e181681c079
dashboard link: https://syzkaller.appspot.com/bug?extid=2fb1a0453669b9bd90e4
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/88220954516a/disk-d7543167.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c9062e074717/vmlinux-d7543167.xz
kernel image: https://storage.googleapis.com/syzbot-assets/70391b45a752/bzImage-d7543167.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+2fb1a0...@syzkaller.appspotmail.com

=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
6.1.82-syzkaller #0 Not tainted
-----------------------------------------------------
syz-executor.4/27027 [HC0[0]:SC0[6]:HE0:SE0] is trying to acquire:
ffff88801b640a40 (&stab->lock){+.-.}-{2:2}, at: __sock_map_delete net/core/sock_map.c:416 [inline]
ffff88801b640a40 (&stab->lock){+.-.}-{2:2}, at: sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448

and this task is already holding:
ffff88806c2cc158 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x3a/0x390 drivers/tty/tty_buffer.c:628
which would create a new lock dependency:
(&port->lock){-.-.}-{2:2} -> (&stab->lock){+.-.}-{2:2}

but this new dependency connects a HARDIRQ-irq-safe lock:
(&port->lock){-.-.}-{2:2}

... which became HARDIRQ-irq-safe at:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
tty_port_tty_get drivers/tty/tty_port.c:327 [inline]
tty_port_default_wakeup+0x1f/0xf0 drivers/tty/tty_port.c:68
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1860
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1967
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1987
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
uart_write+0x6af/0x930 drivers/tty/serial/serial_core.c:600
process_output_block drivers/tty/n_tty.c:586 [inline]
n_tty_write+0xd7f/0x1260 drivers/tty/n_tty.c:2367
do_tty_write drivers/tty/tty_io.c:1018 [inline]
file_tty_write+0x504/0x890 drivers/tty/tty_io.c:1089
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x7ae/0xba0 fs/read_write.c:584
ksys_write+0x19c/0x2c0 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd

to a HARDIRQ-irq-unsafe lock:
(&stab->lock){+.-.}-{2:2}

... which became HARDIRQ-irq-unsafe at:
...
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x1e/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
__bpf_trace_sys_enter+0x60/0x70 include/trace/events/syscalls.h:18
trace_sys_enter include/trace/events/syscalls.h:18 [inline]
syscall_trace_enter kernel/entry/common.c:81 [inline]
__syscall_enter_from_user_work kernel/entry/common.c:94 [inline]
syscall_enter_from_user_mode+0x201/0x220 kernel/entry/common.c:112
do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:77
entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Possible interrupt unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&stab->lock);
local_irq_disable();
lock(&port->lock);
lock(&stab->lock);
<Interrupt>
lock(&port->lock);

*** DEADLOCK ***

5 locks held by syz-executor.4/27027:
#0: ffff888077f5a248 (&pch->upl){++..}-{2:2}, at: ppp_channel_push+0x2c/0x220 drivers/net/ppp/ppp_generic.c:2171
#1: ffff888077f5a1e0 (&pch->downl){+...}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
#1: ffff888077f5a1e0 (&pch->downl){+...}-{2:2}, at: __ppp_channel_push+0x31/0x1d0 drivers/net/ppp/ppp_generic.c:2146
#2: ffff888073ad4030 (&ap->xmit_lock){+...}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
#2: ffff888073ad4030 (&ap->xmit_lock){+...}-{2:2}, at: ppp_async_push+0x98/0x1ae0 drivers/net/ppp/ppp_async.c:667
#3: ffff88806c2cc158 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x3a/0x390 drivers/tty/tty_buffer.c:628
#4: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:319 [inline]
#4: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:760 [inline]
#4: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
#4: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16a/0x470 kernel/trace/bpf_trace.c:2314

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-> (&port->lock){-.-.}-{2:2} {
IN-HARDIRQ-W at:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
tty_port_tty_get drivers/tty/tty_port.c:327 [inline]
tty_port_default_wakeup+0x1f/0xf0 drivers/tty/tty_port.c:68
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1860
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1967
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1987
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
uart_write+0x6af/0x930 drivers/tty/serial/serial_core.c:600
process_output_block drivers/tty/n_tty.c:586 [inline]
n_tty_write+0xd7f/0x1260 drivers/tty/n_tty.c:2367
do_tty_write drivers/tty/tty_io.c:1018 [inline]
file_tty_write+0x504/0x890 drivers/tty/tty_io.c:1089
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x7ae/0xba0 fs/read_write.c:584
ksys_write+0x19c/0x2c0 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
IN-SOFTIRQ-W at:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
tty_port_tty_get drivers/tty/tty_port.c:327 [inline]
tty_port_default_wakeup+0x1f/0xf0 drivers/tty/tty_port.c:68
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1860
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1967
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1987
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644
stack_trace_consume_entry+0x12a/0x270 kernel/stacktrace.c:95
arch_stack_walk+0x101/0x140 arch/x86/kernel/stacktrace.c:27
stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
kmem_cache_free+0x292/0x510 mm/slub.c:3683
rcu_do_batch kernel/rcu/tree.c:2296 [inline]
rcu_core+0xad4/0x17e0 kernel/rcu/tree.c:2556
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x43/0xb0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653
INITIAL USE at:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline]
_raw_spin_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:170
spin_lock_irq include/linux/spinlock.h:376 [inline]
tty_port_open+0x37/0x2c0 drivers/tty/tty_port.c:768
uart_open+0x43/0x50 drivers/tty/serial/serial_core.c:1938
tty_open+0x4c2/0xdd0 drivers/tty/tty_io.c:2145
chrdev_open+0x54a/0x630 fs/char_dev.c:414
do_dentry_open+0x7f9/0x10f0 fs/open.c:882
do_open fs/namei.c:3628 [inline]
path_openat+0x2644/0x2e60 fs/namei.c:3785
do_filp_open+0x230/0x480 fs/namei.c:3812
file_open_name fs/open.c:1263 [inline]
filp_open+0x25d/0x2c0 fs/open.c:1283
console_on_rootfs+0x19/0x5c init/main.c:1581
kernel_init_freeable+0x466/0x60f init/main.c:1629
kernel_init+0x19/0x290 init/main.c:1512
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:307
}
... key at: [<ffffffff920145c0>] tty_port_init.__key.7+0x0/0x20

the dependencies between the lock to be acquired
and HARDIRQ-irq-unsafe lock:
-> (&stab->lock){+.-.}-{2:2} {
HARDIRQ-ON-W at:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x1e/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
__bpf_trace_sys_enter+0x60/0x70 include/trace/events/syscalls.h:18
trace_sys_enter include/trace/events/syscalls.h:18 [inline]
syscall_trace_enter kernel/entry/common.c:81 [inline]
__syscall_enter_from_user_work kernel/entry/common.c:94 [inline]
syscall_enter_from_user_mode+0x201/0x220 kernel/entry/common.c:112
do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:77
entry_SYSCALL_64_after_hwframe+0x63/0xcd
IN-SOFTIRQ-W at:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314
__bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:177
trace_mm_page_alloc include/trace/events/kmem.h:177 [inline]
__alloc_pages+0x717/0x770 mm/page_alloc.c:5567
__alloc_pages_node include/linux/gfp.h:237 [inline]
alloc_pages_node+0x127/0x1b0 include/linux/gfp.h:260
page_frag_alloc_1k net/core/skbuff.c:163 [inline]
__napi_alloc_skb+0x34b/0x520 net/core/skbuff.c:681
napi_alloc_skb include/linux/skbuff.h:3231 [inline]
page_to_skb+0x282/0xb60 drivers/net/virtio_net.c:501
receive_mergeable drivers/net/virtio_net.c:1128 [inline]
receive_buf+0x436/0x5520 drivers/net/virtio_net.c:1267
virtnet_receive drivers/net/virtio_net.c:1562 [inline]
virtnet_poll+0x6d3/0x1470 drivers/net/virtio_net.c:1680
__napi_poll+0xc7/0x470 net/core/dev.c:6537
napi_poll net/core/dev.c:6604 [inline]
net_rx_action+0x70f/0xeb0 net/core/dev.c:6715
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
common_interrupt+0x4f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644
INITIAL USE at:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x1e/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
__bpf_trace_sys_enter+0x60/0x70 include/trace/events/syscalls.h:18
trace_sys_enter include/trace/events/syscalls.h:18 [inline]
syscall_trace_enter kernel/entry/common.c:81 [inline]
__syscall_enter_from_user_work kernel/entry/common.c:94 [inline]
syscall_enter_from_user_mode+0x201/0x220 kernel/entry/common.c:112
do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:77
entry_SYSCALL_64_after_hwframe+0x63/0xcd
}
... key at: [<ffffffff920af2e0>] sock_map_alloc.__key+0x0/0x20
... acquired at:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314
__bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:177
trace_mm_page_alloc include/trace/events/kmem.h:177 [inline]
__alloc_pages+0x717/0x770 mm/page_alloc.c:5567
__stack_depot_save+0x372/0x470 lib/stackdepot.c:474
save_stack+0x104/0x1e0 mm/page_owner.c:128
__set_page_owner+0x26/0x390 mm/page_owner.c:190
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
prep_new_page mm/page_alloc.c:2520 [inline]
get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5545
__stack_depot_save+0x372/0x470 lib/stackdepot.c:474
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x60/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc+0xb2/0x230 mm/slab_common.c:968
kmalloc include/linux/slab.h:561 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:180 [inline]
__tty_buffer_request_room+0x1f1/0x470 drivers/tty/tty_buffer.c:278
tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:327 [inline]
tty_insert_flip_string include/linux/tty_flip.h:41 [inline]
tty_insert_flip_string_and_push_buffer+0x7c/0x390 drivers/tty/tty_buffer.c:629
ppp_async_push+0x319/0x1ae0 drivers/net/ppp/ppp_async.c:674
ppp_async_send+0xd8/0x100 drivers/net/ppp/ppp_async.c:642
__ppp_channel_push+0xff/0x1d0 drivers/net/ppp/ppp_generic.c:2150
ppp_channel_push+0x196/0x220 drivers/net/ppp/ppp_generic.c:2177
ppp_write+0x1f1/0x290 drivers/net/ppp/ppp_generic.c:523
do_iter_write+0x503/0xc50 fs/read_write.c:863
vfs_writev fs/read_write.c:934 [inline]
do_pwritev+0x216/0x360 fs/read_write.c:1031
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd


stack backtrace:
CPU: 0 PID: 27027 Comm: syz-executor.4 Not tainted 6.1.82-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_bad_irq_dependency kernel/locking/lockdep.c:2604 [inline]
check_irq_usage kernel/locking/lockdep.c:2843 [inline]
check_prev_add kernel/locking/lockdep.c:3094 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain+0x4d16/0x5950 kernel/locking/lockdep.c:3825
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314
__bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:177
trace_mm_page_alloc include/trace/events/kmem.h:177 [inline]
__alloc_pages+0x717/0x770 mm/page_alloc.c:5567
__stack_depot_save+0x372/0x470 lib/stackdepot.c:474
save_stack+0x104/0x1e0 mm/page_owner.c:128
__set_page_owner+0x26/0x390 mm/page_owner.c:190
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
prep_new_page mm/page_alloc.c:2520 [inline]
get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5545
__stack_depot_save+0x372/0x470 lib/stackdepot.c:474
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x60/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc+0xb2/0x230 mm/slab_common.c:968
kmalloc include/linux/slab.h:561 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:180 [inline]
__tty_buffer_request_room+0x1f1/0x470 drivers/tty/tty_buffer.c:278
tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:327 [inline]
tty_insert_flip_string include/linux/tty_flip.h:41 [inline]
tty_insert_flip_string_and_push_buffer+0x7c/0x390 drivers/tty/tty_buffer.c:629
ppp_async_push+0x319/0x1ae0 drivers/net/ppp/ppp_async.c:674
ppp_async_send+0xd8/0x100 drivers/net/ppp/ppp_async.c:642
__ppp_channel_push+0xff/0x1d0 drivers/net/ppp/ppp_generic.c:2150
ppp_channel_push+0x196/0x220 drivers/net/ppp/ppp_generic.c:2177
ppp_write+0x1f1/0x290 drivers/net/ppp/ppp_generic.c:523
do_iter_write+0x503/0xc50 fs/read_write.c:863
vfs_writev fs/read_write.c:934 [inline]
do_pwritev+0x216/0x360 fs/read_write.c:1031
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f53c587dda9
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:00007f53c656a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000128
RAX: ffffffffffffffda RBX: 00007f53c59abf80 RCX: 00007f53c587dda9
RDX: 0000000000000003 RSI: 0000000020000380 RDI: 0000000000000009
RBP: 00007f53c58ca47a R08: 0000000000000004 R09: 0000000000000000
R10: 00000000000000f1 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f53c59abf80 R15: 00007ffc5b8cd188
</TASK>
------------[ cut here ]------------
raw_local_irq_restore() called with IRQs enabled
WARNING: CPU: 0 PID: 27027 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10
Modules linked in:
CPU: 0 PID: 27027 Comm: syz-executor.4 Not tainted 6.1.82-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
RIP: 0010:warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10
Code: 24 48 c7 c7 80 bb ea 8a e8 1c f5 fd ff 80 3d 4d e4 d5 03 00 74 01 c3 c6 05 43 e4 d5 03 01 48 c7 c7 e0 e5 eb 8a e8 b3 f3 c8 f6 <0f> 0b c3 41 56 53 48 83 ec 10 65 48 8b 04 25 28 00 00 00 48 89 44
RSP: 0018:ffffc9000cbd7858 EFLAGS: 00010246
RAX: c9eae1410100fe00 RBX: 1ffff9200197af10 RCX: 0000000000040000
RDX: ffffc900068e3000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc9000cbd78f0 R08: ffffffff81527e8e R09: fffff5200197ae6d
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 1ffff9200197af0c R14: ffffc9000cbd7880 R15: 0000000000000246
FS: 00007f53c656a6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9106cd66e4 CR3: 000000009b126000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline]
_raw_spin_unlock_irqrestore+0x118/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
tty_insert_flip_string_and_push_buffer+0x2f3/0x390 drivers/tty/tty_buffer.c:632
ppp_async_push+0x319/0x1ae0 drivers/net/ppp/ppp_async.c:674
ppp_async_send+0xd8/0x100 drivers/net/ppp/ppp_async.c:642
__ppp_channel_push+0xff/0x1d0 drivers/net/ppp/ppp_generic.c:2150
ppp_channel_push+0x196/0x220 drivers/net/ppp/ppp_generic.c:2177
ppp_write+0x1f1/0x290 drivers/net/ppp/ppp_generic.c:523
do_iter_write+0x503/0xc50 fs/read_write.c:863
vfs_writev fs/read_write.c:934 [inline]
do_pwritev+0x216/0x360 fs/read_write.c:1031
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f53c587dda9
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:00007f53c656a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000128
RAX: ffffffffffffffda RBX: 00007f53c59abf80 RCX: 00007f53c587dda9
RDX: 0000000000000003 RSI: 0000000020000380 RDI: 0000000000000009
RBP: 00007f53c58ca47a R08: 0000000000000004 R09: 0000000000000000
R10: 00000000000000f1 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f53c59abf80 R15: 00007ffc5b8cd188
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Mar 27, 2024, 3:34:24 AMMar 27
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9465fef4ae35 Linux 5.15.153
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1517c965180000
kernel config: https://syzkaller.appspot.com/x/.config?x=176c746ee3348b33
dashboard link: https://syzkaller.appspot.com/bug?extid=1d7f33145ac836b5c819
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2962c02652ce/disk-9465fef4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d0f5a1ce082d/vmlinux-9465fef4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/86b5b1eea636/bzImage-9465fef4.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+1d7f33...@syzkaller.appspotmail.com

=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
5.15.153-syzkaller #0 Not tainted
-----------------------------------------------------
syz-executor.4/3667 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire:
ffff88801f9419c0 (&stab->lock){+...}-{2:2}, at: __sock_map_delete net/core/sock_map.c:416 [inline]
ffff88801f9419c0 (&stab->lock){+...}-{2:2}, at: sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448

and this task is already holding:
ffff88807c223158 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x3a/0x390 drivers/tty/tty_buffer.c:585
which would create a new lock dependency:
(&port->lock){-.-.}-{2:2} -> (&stab->lock){+...}-{2:2}

but this new dependency connects a HARDIRQ-irq-safe lock:
(&port->lock){-.-.}-{2:2}

... which became HARDIRQ-irq-safe at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
tty_port_tty_get drivers/tty/tty_port.c:289 [inline]
tty_port_default_wakeup+0x21/0x100 drivers/tty/tty_port.c:48
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1834
serial8250_handle_irq+0x505/0x600 drivers/tty/serial/8250/8250_port.c:1930
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1947
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x292/0xa70 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xff/0x2b0 kernel/irq/handle.c:213
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:822
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:629
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:418 [inline]
uart_write+0x6af/0x930 drivers/tty/serial/serial_core.c:590
process_output_block drivers/tty/n_tty.c:592 [inline]
n_tty_write+0xd7e/0x1280 drivers/tty/n_tty.c:2339
do_tty_write drivers/tty/tty_io.c:1038 [inline]
file_tty_write+0x561/0x920 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2148 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacf/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb

to a HARDIRQ-irq-unsafe lock:
(&stab->lock){+...}-{2:2}

... which became HARDIRQ-irq-unsafe at:
...
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x3a/0x130
bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
__bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201
trace_mm_page_alloc include/trace/events/kmem.h:201 [inline]
__alloc_pages+0x6e0/0x700 mm/page_alloc.c:5443
__page_cache_alloc+0xd4/0x4a0 mm/filemap.c:1022
pagecache_get_page+0xa91/0x1010 mm/filemap.c:1940
grab_cache_page_write_begin+0x57/0x90 mm/filemap.c:3739
ext4_da_write_begin+0x599/0xb60 fs/ext4/inode.c:2980
generic_perform_write+0x2bf/0x5b0 mm/filemap.c:3785
ext4_buffered_write_iter+0x227/0x360 fs/ext4/file.c:268
ext4_file_write_iter+0x87c/0x1990
call_write_iter include/linux/fs.h:2148 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacf/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb

other info that might help us debug this:

Possible interrupt unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&stab->lock);
local_irq_disable();
lock(&port->lock);
lock(&stab->lock);
<Interrupt>
lock(&port->lock);

*** DEADLOCK ***

6 locks held by syz-executor.4/3667:
#0: ffff888077ed6098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252
#1: ffff888077ed6130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:961 [inline]
#1: ffff888077ed6130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:984 [inline]
#1: ffff888077ed6130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write+0x24f/0x920 drivers/tty/tty_io.c:1110
#2: ffff888077ed62e8 (&tty->termios_rwsem){++++}-{3:3}, at: n_tty_write+0x1003/0x1280 drivers/tty/n_tty.c:2384
#3: ffffc900010e8378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0x5ee/0x1280 drivers/tty/n_tty.c:2361
#4: ffff88807c223158 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x3a/0x390 drivers/tty/tty_buffer.c:585
#5: ffffffff8c91f720 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-> (&port->lock){-.-.}-{2:2} {
IN-HARDIRQ-W at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
tty_port_tty_get drivers/tty/tty_port.c:289 [inline]
tty_port_default_wakeup+0x21/0x100 drivers/tty/tty_port.c:48
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1834
serial8250_handle_irq+0x505/0x600 drivers/tty/serial/8250/8250_port.c:1930
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1947
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x292/0xa70 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xff/0x2b0 kernel/irq/handle.c:213
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:822
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:629
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:418 [inline]
uart_write+0x6af/0x930 drivers/tty/serial/serial_core.c:590
process_output_block drivers/tty/n_tty.c:592 [inline]
n_tty_write+0xd7e/0x1280 drivers/tty/n_tty.c:2339
do_tty_write drivers/tty/tty_io.c:1038 [inline]
file_tty_write+0x561/0x920 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2148 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacf/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
IN-SOFTIRQ-W at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
tty_port_tty_get drivers/tty/tty_port.c:289 [inline]
tty_port_default_wakeup+0x21/0x100 drivers/tty/tty_port.c:48
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1834
serial8250_handle_irq+0x505/0x600 drivers/tty/serial/8250/8250_port.c:1930
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1947
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x292/0xa70 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xff/0x2b0 kernel/irq/handle.c:213
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:822
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0x4a/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:629
ffs arch/x86/include/asm/bitops.h:297 [inline]
__do_softirq+0x1d2/0x93a kernel/softirq.c:546
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1096
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638
console_unlock+0xe53/0x12b0 kernel/printk/printk.c:2743
vprintk_emit+0xbf/0x150 kernel/printk/printk.c:2268
_printk+0xd1/0x111 kernel/printk/printk.c:2293
check_stack_usage kernel/exit.c:764 [inline]
do_exit+0x1a91/0x2480 kernel/exit.c:915
do_group_exit+0x144/0x310 kernel/exit.c:994
__do_sys_exit_group kernel/exit.c:1005 [inline]
__se_sys_exit_group kernel/exit.c:1003 [inline]
__x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1003
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
INITIAL USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline]
_raw_spin_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:170
spin_lock_irq include/linux/spinlock.h:388 [inline]
tty_port_open+0x39/0x2c0 drivers/tty/tty_port.c:678
uart_open+0x43/0x50 drivers/tty/serial/serial_core.c:1813
tty_open+0x4c8/0xde0 drivers/tty/tty_io.c:2165
chrdev_open+0x54a/0x630 fs/char_dev.c:414
do_dentry_open+0x807/0xfb0 fs/open.c:826
do_open fs/namei.c:3608 [inline]
path_openat+0x2702/0x2f20 fs/namei.c:3742
do_filp_open+0x21c/0x460 fs/namei.c:3769
file_open_name fs/open.c:1156 [inline]
filp_open+0x25d/0x2c0 fs/open.c:1176
console_on_rootfs+0x19/0x5c init/main.c:1571
kernel_init_freeable+0x42f/0x5b5 init/main.c:1618
kernel_init+0x19/0x290 init/main.c:1504
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
}
... key at: [<ffffffff916edb20>] tty_port_init.__key.7+0x0/0x20

the dependencies between the lock to be acquired
and HARDIRQ-irq-unsafe lock:
-> (&stab->lock){+...}-{2:2} {
HARDIRQ-ON-W at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x3a/0x130
bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
__bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201
trace_mm_page_alloc include/trace/events/kmem.h:201 [inline]
__alloc_pages+0x6e0/0x700 mm/page_alloc.c:5443
__page_cache_alloc+0xd4/0x4a0 mm/filemap.c:1022
pagecache_get_page+0xa91/0x1010 mm/filemap.c:1940
grab_cache_page_write_begin+0x57/0x90 mm/filemap.c:3739
ext4_da_write_begin+0x599/0xb60 fs/ext4/inode.c:2980
generic_perform_write+0x2bf/0x5b0 mm/filemap.c:3785
ext4_buffered_write_iter+0x227/0x360 fs/ext4/file.c:268
ext4_file_write_iter+0x87c/0x1990
call_write_iter include/linux/fs.h:2148 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacf/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
INITIAL USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x3a/0x130
bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
__bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201
trace_mm_page_alloc include/trace/events/kmem.h:201 [inline]
__alloc_pages+0x6e0/0x700 mm/page_alloc.c:5443
alloc_pages_vma+0x39a/0x800 mm/mempolicy.c:2146
do_anonymous_page mm/memory.c:3808 [inline]
handle_pte_fault mm/memory.c:4619 [inline]
__handle_mm_fault mm/memory.c:4756 [inline]
handle_mm_fault+0x2f49/0x5950 mm/memory.c:4854
do_user_addr_fault arch/x86/mm/fault.c:1388 [inline]
handle_page_fault arch/x86/mm/fault.c:1476 [inline]
exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1532
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
}
... key at: [<ffffffff9178a720>] sock_map_alloc.__key+0x0/0x20
... acquired at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x3a/0x130
bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
__bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201
trace_mm_page_alloc include/trace/events/kmem.h:201 [inline]
__alloc_pages+0x6e0/0x700 mm/page_alloc.c:5443
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
__kmalloc+0x1c9/0x300 mm/slub.c:4403
kmalloc include/linux/slab.h:596 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline]
__tty_buffer_request_room+0x1ef/0x500 drivers/tty/tty_buffer.c:276
tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:322 [inline]
tty_insert_flip_string include/linux/tty_flip.h:41 [inline]
tty_insert_flip_string_and_push_buffer+0x7c/0x390 drivers/tty/tty_buffer.c:586
n_tty_write+0x63c/0x1280 drivers/tty/n_tty.c:2362
do_tty_write drivers/tty/tty_io.c:1038 [inline]
file_tty_write+0x561/0x920 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2148 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacf/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb


stack backtrace:
CPU: 1 PID: 3667 Comm: syz-executor.4 Not tainted 5.15.153-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_bad_irq_dependency kernel/locking/lockdep.c:2567 [inline]
check_irq_usage kernel/locking/lockdep.c:2806 [inline]
check_prev_add kernel/locking/lockdep.c:3057 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x4d01/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
__sock_map_delete net/core/sock_map.c:416 [inline]
sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448
bpf_prog_2c29ac5cdc6b1842+0x3a/0x130
bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
__bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201
trace_mm_page_alloc include/trace/events/kmem.h:201 [inline]
__alloc_pages+0x6e0/0x700 mm/page_alloc.c:5443
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
__kmalloc+0x1c9/0x300 mm/slub.c:4403
kmalloc include/linux/slab.h:596 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline]
__tty_buffer_request_room+0x1ef/0x500 drivers/tty/tty_buffer.c:276
tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:322 [inline]
tty_insert_flip_string include/linux/tty_flip.h:41 [inline]
tty_insert_flip_string_and_push_buffer+0x7c/0x390 drivers/tty/tty_buffer.c:586
n_tty_write+0x63c/0x1280 drivers/tty/n_tty.c:2362
do_tty_write drivers/tty/tty_io.c:1038 [inline]
file_tty_write+0x561/0x920 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2148 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacf/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f6b5a04fda9
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:00007f6b585d00c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f6b5a17df80 RCX: 00007f6b5a04fda9
RDX: 000000000000ff2e RSI: 0000000020000000 RDI: 0000000000000005
RBP: 00007f6b5a09c47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f6b5a17df80 R15: 00007ffd5e18e858
Reply all
Reply to author
Forward
0 new messages