syzbot


possible deadlock in serial8250_console_write

Status: upstream: reported on 2024/04/02 17:32
Subsystems: hams
[Documentation on labels]
Reported-by: syzbot+8e03da5d64bc85098811@syzkaller.appspotmail.com
First crash: 19d, last: 6d14h
Discussions (4)
Title Replies (including bot) Last reply
[PATCH net,v3] net: hams: Fix deadlock caused by unsafe-irq lock in sp_get() 3 (3) 2024/04/20 08:21
[syzbot] [hams?] possible deadlock in serial8250_console_write 1 (3) 2024/04/20 06:09
[PATCH v2] net: hams: Fix deadlock caused by unsafe-irq lock in sp_get() 1 (1) 2024/04/19 17:43
[PATCH] hams: Fix deadlock caused by unsafe-irq lock in sp_get() 1 (1) 2024/04/18 17:30
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 possible deadlock in serial8250_console_write 1 1958d 1834d 0/1 auto-closed as invalid on 2019/06/08 21:57

Sample crash report:
=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted
-----------------------------------------------------
kworker/0:4/5128 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffffffff8e8112d8 (disc_data_lock){.+.+}-{2:2}, at: sp_get+0x18/0xf0 drivers/net/hamradio/6pack.c:376

and this task is already holding:
ffffffff949172f8 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:616 [inline]
ffffffff949172f8 (&port_lock_key){-.-.}-{2:2}, at: serial_port_runtime_resume+0xd3/0x340 drivers/tty/serial/serial_port.c:38
which would create a new lock dependency:
 (&port_lock_key){-.-.}-{2:2} -> (disc_data_lock){.+.+}-{2:2}

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

... which became HARDIRQ-irq-safe at:
  lock_acquire kernel/locking/lockdep.c:5754 [inline]
  lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
  _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
  uart_port_lock_irqsave include/linux/serial_core.h:616 [inline]
  serial8250_console_write+0xaa6/0x1090 drivers/tty/serial/8250/8250_port.c:3403
  console_emit_next_record kernel/printk/printk.c:2907 [inline]
  console_flush_all+0x53c/0xd70 kernel/printk/printk.c:2973
  console_unlock+0xae/0x290 kernel/printk/printk.c:3042
  vprintk_emit kernel/printk/printk.c:2342 [inline]
  vprintk_emit+0x11a/0x5a0 kernel/printk/printk.c:2297
  vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
  _printk+0xc8/0x100 kernel/printk/printk.c:2367
  vkms_vblank_simulate+0xd4/0x3e0 drivers/gpu/drm/vkms/vkms_crtc.c:26
  __run_hrtimer kernel/time/hrtimer.c:1692 [inline]
  __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1756
  hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1818
  local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
  __sysvec_apic_timer_interrupt+0x10f/0x410 arch/x86/kernel/apic/apic.c:1049
  instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
  sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1043
  asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
  __outl arch/x86/include/asm/shared/io.h:24 [inline]
  iowrite32+0x59/0x80 lib/iomap.c:225
  setup_vq+0x1a4/0x2f0 drivers/virtio/virtio_pci_legacy.c:150
  vp_setup_vq+0xb1/0x380 drivers/virtio/virtio_pci_common.c:189
  vp_find_vqs_msix+0x661/0xe30 drivers/virtio/virtio_pci_common.c:331
  vp_find_vqs+0x58/0x560 drivers/virtio/virtio_pci_common.c:408
  virtio_find_vqs_ctx include/linux/virtio_config.h:242 [inline]
  virtnet_find_vqs drivers/net/virtio_net.c:4347 [inline]
  init_vqs+0xb04/0x1770 drivers/net/virtio_net.c:4436
  virtnet_probe+0x15d1/0x3980 drivers/net/virtio_net.c:4756
  virtio_dev_probe+0x5ff/0x9b0 drivers/virtio/virtio.c:311
  call_driver_probe drivers/base/dd.c:579 [inline]
  really_probe+0x23a/0xcb0 drivers/base/dd.c:658
  __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
  driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830
  __driver_attach+0x283/0x580 drivers/base/dd.c:1216
  bus_for_each_dev+0x13c/0x1d0 drivers/base/bus.c:368
  bus_add_driver+0x2ed/0x640 drivers/base/bus.c:673
  driver_register+0x15c/0x4b0 drivers/base/driver.c:246
  virtio_net_driver_init+0xac/0xd0 drivers/net/virtio_net.c:5003
  do_one_initcall+0x128/0x690 init/main.c:1241
  do_initcall_level init/main.c:1303 [inline]
  do_initcalls init/main.c:1319 [inline]
  do_basic_setup init/main.c:1338 [inline]
  kernel_init_freeable+0x69d/0xc40 init/main.c:1550
  kernel_init+0x1c/0x2a0 init/main.c:1439
  ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243

to a HARDIRQ-irq-unsafe lock:
 (disc_data_lock){.+.+}-{2:2}

... which became HARDIRQ-irq-unsafe at:
...
  lock_acquire kernel/locking/lockdep.c:5754 [inline]
  lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
  __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
  _raw_read_lock+0x5f/0x70 kernel/locking/spinlock.c:228
  sp_get+0x18/0xf0 drivers/net/hamradio/6pack.c:376
  sixpack_receive_buf drivers/net/hamradio/6pack.c:439 [inline]
  sixpack_receive_buf+0x59/0x1c90 drivers/net/hamradio/6pack.c:430
  tiocsti drivers/tty/tty_io.c:2299 [inline]
  tty_ioctl+0x581/0x1590 drivers/tty/tty_io.c:2717
  vfs_ioctl fs/ioctl.c:51 [inline]
  __do_sys_ioctl fs/ioctl.c:904 [inline]
  __se_sys_ioctl fs/ioctl.c:890 [inline]
  __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:890
  do_syscall_x64 arch/x86/entry/common.c:52 [inline]
  do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83
  entry_SYSCALL_64_after_hwframe+0x6d/0x75

other info that might help us debug this:

 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(disc_data_lock);
                               local_irq_disable();
                               lock(&port_lock_key);
                               lock(disc_data_lock);
  <Interrupt>
    lock(&port_lock_key);

 *** DEADLOCK ***

4 locks held by kworker/0:4/5128:
 #0: ffff888018689d48 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work+0x1296/0x1a60 kernel/workqueue.c:3229
 #1: ffffc90003e4fd80 ((work_completion)(&dev->power.work)){+.+.}-{0:0}, at: process_one_work+0x906/0x1a60 kernel/workqueue.c:3230
 #2: ffffffff949172f8 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:616 [inline]
 #2: ffffffff949172f8 (&port_lock_key){-.-.}-{2:2}, at: serial_port_runtime_resume+0xd3/0x340 drivers/tty/serial/serial_port.c:38
 #3: ffff88801b7aa0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1c/0x80 drivers/tty/tty_ldisc.c:263

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-> (&port_lock_key){-.-.}-{2:2} {
   IN-HARDIRQ-W at:
                    lock_acquire kernel/locking/lockdep.c:5754 [inline]
                    lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
                    __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                    _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
                    uart_port_lock_irqsave include/linux/serial_core.h:616 [inline]
                    serial8250_console_write+0xaa6/0x1090 drivers/tty/serial/8250/8250_port.c:3403
                    console_emit_next_record kernel/printk/printk.c:2907 [inline]
                    console_flush_all+0x53c/0xd70 kernel/printk/printk.c:2973
                    console_unlock+0xae/0x290 kernel/printk/printk.c:3042
                    vprintk_emit kernel/printk/printk.c:2342 [inline]
                    vprintk_emit+0x11a/0x5a0 kernel/printk/printk.c:2297
                    vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
                    _printk+0xc8/0x100 kernel/printk/printk.c:2367
                    vkms_vblank_simulate+0xd4/0x3e0 drivers/gpu/drm/vkms/vkms_crtc.c:26
                    __run_hrtimer kernel/time/hrtimer.c:1692 [inline]
                    __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1756
                    hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1818
                    local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
                    __sysvec_apic_timer_interrupt+0x10f/0x410 arch/x86/kernel/apic/apic.c:1049
                    instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
                    sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1043
                    asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
                    __outl arch/x86/include/asm/shared/io.h:24 [inline]
                    iowrite32+0x59/0x80 lib/iomap.c:225
                    setup_vq+0x1a4/0x2f0 drivers/virtio/virtio_pci_legacy.c:150
                    vp_setup_vq+0xb1/0x380 drivers/virtio/virtio_pci_common.c:189
                    vp_find_vqs_msix+0x661/0xe30 drivers/virtio/virtio_pci_common.c:331
                    vp_find_vqs+0x58/0x560 drivers/virtio/virtio_pci_common.c:408
                    virtio_find_vqs_ctx include/linux/virtio_config.h:242 [inline]
                    virtnet_find_vqs drivers/net/virtio_net.c:4347 [inline]
                    init_vqs+0xb04/0x1770 drivers/net/virtio_net.c:4436
                    virtnet_probe+0x15d1/0x3980 drivers/net/virtio_net.c:4756
                    virtio_dev_probe+0x5ff/0x9b0 drivers/virtio/virtio.c:311
                    call_driver_probe drivers/base/dd.c:579 [inline]
                    really_probe+0x23a/0xcb0 drivers/base/dd.c:658
                    __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
                    driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830
                    __driver_attach+0x283/0x580 drivers/base/dd.c:1216
                    bus_for_each_dev+0x13c/0x1d0 drivers/base/bus.c:368
                    bus_add_driver+0x2ed/0x640 drivers/base/bus.c:673
                    driver_register+0x15c/0x4b0 drivers/base/driver.c:246
                    virtio_net_driver_init+0xac/0xd0 drivers/net/virtio_net.c:5003
                    do_one_initcall+0x128/0x690 init/main.c:1241
                    do_initcall_level init/main.c:1303 [inline]
                    do_initcalls init/main.c:1319 [inline]
                    do_basic_setup init/main.c:1338 [inline]
                    kernel_init_freeable+0x69d/0xc40 init/main.c:1550
                    kernel_init+0x1c/0x2a0 init/main.c:1439
                    ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
                    ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
   IN-SOFTIRQ-W at:
                    lock_acquire kernel/locking/lockdep.c:5754 [inline]
                    lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
                    __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                    _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
                    uart_port_lock_irqsave include/linux/serial_core.h:616 [inline]
                    serial8250_handle_irq+0x95/0x780 drivers/tty/serial/8250/8250_port.c:1913
                    serial8250_default_handle_irq+0x9a/0x210 drivers/tty/serial/8250/8250_port.c:1962
                    serial8250_interrupt+0x103/0x210 drivers/tty/serial/8250/8250_core.c:127
                    __handle_irq_event_percpu+0x229/0x750 kernel/irq/handle.c:158
                    handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
                    handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210
                    handle_edge_irq+0x263/0xd10 kernel/irq/chip.c:831
                    generic_handle_irq_desc include/linux/irqdesc.h:161 [inline]
                    handle_irq arch/x86/kernel/irq.c:238 [inline]
                    __common_interrupt+0xde/0x250 arch/x86/kernel/irq.c:257
                    common_interrupt+0x52/0xd0 arch/x86/kernel/irq.c:247
                    asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
                    unwind_next_frame+0x5e4/0x23a0 arch/x86/kernel/unwind_orc.c:505
                    arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25
                    stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122
                    kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
                    kasan_save_track+0x14/0x30 mm/kasan/common.c:68
                    kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579
                    poison_slab_object mm/kasan/common.c:240 [inline]
                    __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256
                    kasan_slab_free include/linux/kasan.h:184 [inline]
                    slab_free_hook mm/slub.c:2106 [inline]
                    slab_free mm/slub.c:4280 [inline]
                    kmem_cache_free+0x12e/0x360 mm/slub.c:4344
                    rcu_do_batch kernel/rcu/tree.c:2196 [inline]
                    rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2471
                    __do_softirq+0x218/0x8de kernel/softirq.c:554
                    invoke_softirq kernel/softirq.c:428 [inline]
                    __irq_exit_rcu kernel/softirq.c:633 [inline]
                    irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645
                    instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
                    sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043
                    asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
                    check_kcov_mode kernel/kcov.c:173 [inline]
                    write_comp_data+0x2e/0x90 kernel/kcov.c:236
                    __sanitizer_cov_trace_switch+0x54/0x90 kernel/kcov.c:341
                    unwind_next_frame+0x789/0x23a0 arch/x86/kernel/unwind_orc.c:581
                    arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25
                    stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122
                    kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
                    kasan_save_track+0x14/0x30 mm/kasan/common.c:68
                    unpoison_slab_object mm/kasan/common.c:312 [inline]
                    __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338
                    kasan_slab_alloc include/linux/kasan.h:201 [inline]
                    slab_post_alloc_hook mm/slub.c:3798 [inline]
                    slab_alloc_node mm/slub.c:3845 [inline]
                    kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
                    kmem_cache_zalloc include/linux/slab.h:739 [inline]
                    __kernfs_new_node+0xd3/0x8a0 fs/kernfs/dir.c:615
                    kernfs_new_node+0x18c/0x240 fs/kernfs/dir.c:691
                    __kernfs_create_file+0x53/0x340 fs/kernfs/file.c:1025
                    sysfs_add_file_mode_ns+0x1ff/0x3b0 fs/sysfs/file.c:307
                    create_files fs/sysfs/group.c:64 [inline]
                    internal_create_group+0x31f/0xb50 fs/sysfs/group.c:152
                    internal_create_groups+0x9d/0x150 fs/sysfs/group.c:192
                    device_add_groups drivers/base/core.c:2741 [inline]
                    device_add_attrs drivers/base/core.c:2850 [inline]
                    device_add+0x710/0x1ab0 drivers/base/core.c:3593
                    netdev_register_kobject+0x187/0x3f0 net/core/net-sysfs.c:2136
                    register_netdevice+0x12c8/0x1ca0 net/core/dev.c:10274
                    bpq_new_device drivers/net/hamradio/bpqether.c:499 [inline]
                    bpq_device_event+0x3a2/0xaf0 drivers/net/hamradio/bpqether.c:542
                    notifier_call_chain+0xb9/0x3e0 kernel/notifier.c:93
                    call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950
                    call_netdevice_notifiers_extack net/core/dev.c:1988 [inline]
                    call_netdevice_notifiers net/core/dev.c:2002 [inline]
                    __dev_notify_flags+0x12d/0x2e0 net/core/dev.c:8722
                    dev_change_flags+0x10c/0x160 net/core/dev.c:8760
                    devinet_ioctl+0x127a/0x1f10 net/ipv4/devinet.c:1172
                    inet_ioctl+0x3aa/0x3f0 net/ipv4/af_inet.c:1001
                    sock_do_ioctl+0x116/0x280 net/socket.c:1222
                    sock_ioctl+0x22e/0x6c0 net/socket.c:1341
                    vfs_ioctl fs/ioctl.c:51 [inline]
                    __do_sys_ioctl fs/ioctl.c:904 [inline]
                    __se_sys_ioctl fs/ioctl.c:890 [inline]
                    __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:890
                    do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                    do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83
                    entry_SYSCALL_64_after_hwframe+0x6d/0x75
   INITIAL USE at:
                   lock_acquire kernel/locking/lockdep.c:5754 [inline]
                   lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
                   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                   _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
                   uart_port_lock_irqsave include/linux/serial_core.h:616 [inline]
                   serial8250_do_set_termios+0x334/0x1270 drivers/tty/serial/8250/8250_port.c:2793
                   serial8250_set_termios+0x6e/0x80 drivers/tty/serial/8250/8250_port.c:2912
                   uart_set_options+0x31b/0x5f0 drivers/tty/serial/serial_core.c:2320
                   serial8250_console_setup+0x18a/0x460 drivers/tty/serial/8250/8250_port.c:3507
                   univ8250_console_setup+0x16c/0x210 drivers/tty/serial/8250/8250_core.c:632
                   try_enable_preferred_console+0x253/0x480 kernel/printk/printk.c:3308
                   register_console+0x30e/0x1060 kernel/printk/printk.c:3485
                   univ8250_console_init+0x35/0x50 drivers/tty/serial/8250/8250_core.c:717
                   console_init+0xcc/0x5e0 kernel/printk/printk.c:3694
                   start_kernel+0x259/0x490 init/main.c:1012
                   x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:509
                   x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:490
                   common_startup_64+0x13e/0x148
 }
 ... key      at: [<ffffffff94916520>] port_lock_key+0x0/0x40

the dependencies between the lock to be acquired
 and HARDIRQ-irq-unsafe lock:
-> (disc_data_lock){.+.+}-{2:2} {
   HARDIRQ-ON-R at:
                    lock_acquire kernel/locking/lockdep.c:5754 [inline]
                    lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
                    __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                    _raw_read_lock+0x5f/0x70 kernel/locking/spinlock.c:228
                    sp_get+0x18/0xf0 drivers/net/hamradio/6pack.c:376
                    sixpack_receive_buf drivers/net/hamradio/6pack.c:439 [inline]
                    sixpack_receive_buf+0x59/0x1c90 drivers/net/hamradio/6pack.c:430
                    tiocsti drivers/tty/tty_io.c:2299 [inline]
                    tty_ioctl+0x581/0x1590 drivers/tty/tty_io.c:2717
                    vfs_ioctl fs/ioctl.c:51 [inline]
                    __do_sys_ioctl fs/ioctl.c:904 [inline]
                    __se_sys_ioctl fs/ioctl.c:890 [inline]
                    __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:890
                    do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                    do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83
                    entry_SYSCALL_64_after_hwframe+0x6d/0x75
   SOFTIRQ-ON-R at:
                    lock_acquire kernel/locking/lockdep.c:5754 [inline]
                    lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
                    __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                    _raw_read_lock+0x5f/0x70 kernel/locking/spinlock.c:228
                    sp_get+0x18/0xf0 drivers/net/hamradio/6pack.c:376
                    sixpack_receive_buf drivers/net/hamradio/6pack.c:439 [inline]
                    sixpack_receive_buf+0x59/0x1c90 drivers/net/hamradio/6pack.c:430
                    tiocsti drivers/tty/tty_io.c:2299 [inline]
                    tty_ioctl+0x581/0x1590 drivers/tty/tty_io.c:2717
                    vfs_ioctl fs/ioctl.c:51 [inline]
                    __do_sys_ioctl fs/ioctl.c:904 [inline]
                    __se_sys_ioctl fs/ioctl.c:890 [inline]
                    __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:890
                    do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                    do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83
                    entry_SYSCALL_64_after_hwframe+0x6d/0x75
   INITIAL USE at:
                   lock_acquire kernel/locking/lockdep.c:5754 [inline]
                   lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
                   __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                   _raw_write_lock_irq+0x36/0x50 kernel/locking/spinlock.c:326
                   sixpack_close+0x1e/0x2d0 drivers/net/hamradio/6pack.c:653
                   tty_ldisc_close+0x111/0x1a0 drivers/tty/tty_ldisc.c:455
                   tty_ldisc_kill+0x8e/0x150 drivers/tty/tty_ldisc.c:607
                   tty_ldisc_release+0x17b/0x2a0 drivers/tty/tty_ldisc.c:775
                   tty_release_struct+0x23/0xe0 drivers/tty/tty_io.c:1696
                   tty_release+0xe33/0x1420 drivers/tty/tty_io.c:1867
                   __fput+0x270/0xb80 fs/file_table.c:422
                   __fput_sync+0x47/0x50 fs/file_table.c:507
                   __do_sys_close fs/open.c:1556 [inline]
                   __se_sys_close fs/open.c:1541 [inline]
                   __x64_sys_close+0x86/0x100 fs/open.c:1541
                   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                   do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83
                   entry_SYSCALL_64_after_hwframe+0x6d/0x75
   INITIAL READ USE at:
                        lock_acquire kernel/locking/lockdep.c:5754 [inline]
                        lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
                        __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                        _raw_read_lock+0x5f/0x70 kernel/locking/spinlock.c:228
                        sp_get+0x18/0xf0 drivers/net/hamradio/6pack.c:376
                        sixpack_receive_buf drivers/net/hamradio/6pack.c:439 [inline]
                        sixpack_receive_buf+0x59/0x1c90 drivers/net/hamradio/6pack.c:430
                        tiocsti drivers/tty/tty_io.c:2299 [inline]
                        tty_ioctl+0x581/0x1590 drivers/tty/tty_io.c:2717
                        vfs_ioctl fs/ioctl.c:51 [inline]
                        __do_sys_ioctl fs/ioctl.c:904 [inline]
                        __se_sys_ioctl fs/ioctl.c:890 [inline]
                        __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:890
                        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                        do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83
                        entry_SYSCALL_64_after_hwframe+0x6d/0x75
 }
 ... key      at: [<ffffffff8e8112d8>] disc_data_lock+0x18/0xf20
 ... acquired at:
   lock_acquire kernel/locking/lockdep.c:5754 [inline]
   lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
   __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
   _raw_read_lock+0x5f/0x70 kernel/locking/spinlock.c:228
   sp_get+0x18/0xf0 drivers/net/hamradio/6pack.c:376
   sixpack_write_wakeup+0x20/0x390 drivers/net/hamradio/6pack.c:397
   tty_wakeup+0xe5/0x120 drivers/tty/tty_io.c:523
   tty_port_default_wakeup+0x2a/0x40 drivers/tty/tty_port.c:69
   serial8250_tx_chars+0x55a/0x8b0 drivers/tty/serial/8250/8250_port.c:1835
   __start_tx+0x3e9/0x4a0 drivers/tty/serial/8250/8250_port.c:1544
   serial8250_start_tx+0x363/0x530 drivers/tty/serial/8250/8250_port.c:1653
   serial_port_runtime_resume+0x2a4/0x340 drivers/tty/serial/serial_port.c:40
   __rpm_callback+0xc5/0x4c0 drivers/base/power/runtime.c:394
   rpm_callback+0x1da/0x220 drivers/base/power/runtime.c:448
   rpm_resume+0xcf9/0x12f0 drivers/base/power/runtime.c:914
   pm_runtime_work+0x10c/0x150 drivers/base/power/runtime.c:979
   process_one_work+0x9a9/0x1a60 kernel/workqueue.c:3254
   process_scheduled_works kernel/workqueue.c:3335 [inline]
   worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416
   kthread+0x2c1/0x3a0 kernel/kthread.c:388
   ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
   ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243


stack backtrace:
CPU: 0 PID: 5128 Comm: kworker/0:4 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: pm pm_runtime_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114
 print_bad_irq_dependency kernel/locking/lockdep.c:2626 [inline]
 check_irq_usage+0xe3c/0x1490 kernel/locking/lockdep.c:2865
 check_prev_add kernel/locking/lockdep.c:3138 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x248e/0x3b30 kernel/locking/lockdep.c:5137
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
 __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
 _raw_read_lock+0x5f/0x70 kernel/locking/spinlock.c:228
 sp_get+0x18/0xf0 drivers/net/hamradio/6pack.c:376
 sixpack_write_wakeup+0x20/0x390 drivers/net/hamradio/6pack.c:397
 tty_wakeup+0xe5/0x120 drivers/tty/tty_io.c:523
 tty_port_default_wakeup+0x2a/0x40 drivers/tty/tty_port.c:69
 serial8250_tx_chars+0x55a/0x8b0 drivers/tty/serial/8250/8250_port.c:1835
 __start_tx+0x3e9/0x4a0 drivers/tty/serial/8250/8250_port.c:1544
 serial8250_start_tx+0x363/0x530 drivers/tty/serial/8250/8250_port.c:1653
 serial_port_runtime_resume+0x2a4/0x340 drivers/tty/serial/serial_port.c:40
 __rpm_callback+0xc5/0x4c0 drivers/base/power/runtime.c:394
 rpm_callback+0x1da/0x220 drivers/base/power/runtime.c:448
 rpm_resume+0xcf9/0x12f0 drivers/base/power/runtime.c:914
 pm_runtime_work+0x10c/0x150 drivers/base/power/runtime.c:979
 process_one_work+0x9a9/0x1a60 kernel/workqueue.c:3254
 process_scheduled_works kernel/workqueue.c:3335 [inline]
 worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416
 kthread+0x2c1/0x3a0 kernel/kthread.c:388
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
 </TASK>

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/14 18:42 upstream fe46a7dd189e c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in serial8250_console_write
2024/04/02 04:22 upstream fe46a7dd189e 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in serial8250_console_write
2024/04/09 16:15 linux-next a053fd3ca5d1 56086b24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in serial8250_console_write
* Struck through repros no longer work on HEAD.