[v5.15] possible deadlock in input_event

0 views
Skip to first unread message

syzbot

unread,
Jul 17, 2023, 10:44:51 AM7/17/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d54cfc420586 Linux 5.15.120
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1628d5faa80000
kernel config: https://syzkaller.appspot.com/x/.config?x=f546a5c7ff981a94
dashboard link: https://syzkaller.appspot.com/bug?extid=2f5570a645018de96979
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/601dfce79849/disk-d54cfc42.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b8e802138c25/vmlinux-d54cfc42.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9b3b48ff5c05/bzImage-d54cfc42.xz

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

=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
5.15.120-syzkaller #0 Not tainted
-----------------------------------------------------
syz-executor.4/8494 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffffffff8c60a058 (tasklist_lock){.+.+}-{2:2}, at: send_sigio+0xd2/0x330 fs/fcntl.c:810

and this task is already holding:
ffff88802075ab38 (&f->f_owner.lock){...-}-{2:2}, at: send_sigio+0x2f/0x330 fs/fcntl.c:796
which would create a new lock dependency:
(&f->f_owner.lock){...-}-{2:2} -> (tasklist_lock){.+.+}-{2:2}

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

... which became HARDIRQ-irq-safe at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
input_event+0x8a/0xd0 drivers/input/input.c:456
input_report_key include/linux/input.h:425 [inline]
psmouse_report_standard_buttons drivers/input/mouse/psmouse-base.c:123 [inline]
psmouse_report_standard_packet+0x50/0x200 drivers/input/mouse/psmouse-base.c:141
psmouse_process_byte+0x45b/0x640 drivers/input/mouse/psmouse-base.c:232
psmouse_handle_byte+0x46/0x4b0 drivers/input/mouse/psmouse-base.c:274
psmouse_interrupt+0x697/0x10a0 drivers/input/mouse/psmouse-base.c:426
serio_interrupt+0x88/0x130 drivers/input/serio/serio.c:1001
i8042_interrupt+0x355/0x750 drivers/input/serio/i8042.c:606
__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]
i8042_command drivers/input/serio/i8042.c:356 [inline]
i8042_aux_write+0x112/0x190 drivers/input/serio/i8042.c:391
serio_write include/linux/serio.h:125 [inline]
ps2_do_sendbyte+0x20a/0x720 drivers/input/serio/libps2.c:40
ps2_sendbyte+0x5c/0x120 drivers/input/serio/libps2.c:92
cypress_ps2_sendbyte drivers/input/mouse/cypress_ps2.c:42 [inline]
cypress_ps2_read_cmd_status drivers/input/mouse/cypress_ps2.c:116 [inline]
cypress_send_ext_cmd+0x21d/0x900 drivers/input/mouse/cypress_ps2.c:189
cypress_detect+0x8f/0x220 drivers/input/mouse/cypress_ps2.c:205
psmouse_do_detect drivers/input/mouse/psmouse-base.c:1009 [inline]
psmouse_try_protocol drivers/input/mouse/psmouse-base.c:1023 [inline]
psmouse_extensions+0xc2a/0x1550 drivers/input/mouse/psmouse-base.c:1146
psmouse_switch_protocol+0x308/0x840 drivers/input/mouse/psmouse-base.c:1542
psmouse_connect+0x94b/0x1430 drivers/input/mouse/psmouse-base.c:1632
serio_connect_driver drivers/input/serio/serio.c:47 [inline]
serio_driver_probe+0x74/0x90 drivers/input/serio/serio.c:778
really_probe+0x24e/0xb60 drivers/base/dd.c:595
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755
driver_probe_device+0x50/0x420 drivers/base/dd.c:785
__driver_attach+0x479/0x690 drivers/base/dd.c:1164
bus_for_each_dev+0x17c/0x1f0 drivers/base/bus.c:301
serio_attach_driver drivers/input/serio/serio.c:807 [inline]
serio_handle_event+0x56a/0x8f0 drivers/input/serio/serio.c:227
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

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

... which became HARDIRQ-irq-unsafe at:
...
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
do_wait+0x2a7/0xaf0 kernel/exit.c:1576
kernel_wait+0xe5/0x230 kernel/exit.c:1766
call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:166
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

other info that might help us debug this:

Chain exists of:
&dev->event_lock#2 --> &f->f_owner.lock --> tasklist_lock

Possible interrupt unsafe locking scenario:

CPU0 CPU1
---- ----
lock(tasklist_lock);
local_irq_disable();
lock(&dev->event_lock#2);
lock(&f->f_owner.lock);
<Interrupt>
lock(&dev->event_lock#2);

*** DEADLOCK ***

5 locks held by syz-executor.4/8494:
#0: ffff88814b228460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
#1: ffff88802d0817e0 (&type->i_mutex_dir_key#4){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
#1: ffff88802d0817e0 (&type->i_mutex_dir_key#4){++++}-{3:3}, at: open_last_lookups fs/namei.c:3459 [inline]
#1: ffff88802d0817e0 (&type->i_mutex_dir_key#4){++++}-{3:3}, at: path_openat+0x824/0x2f20 fs/namei.c:3669
#2: ffffffff91434f38 (&fsnotify_mark_srcu){....}-{0:0}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:268
#3: ffff88801a704038 (&mark->lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
#3: ffff88801a704038 (&mark->lock){+.+.}-{2:2}, at: dnotify_handle_event+0x5d/0x440 fs/notify/dnotify/dnotify.c:89
#4: ffff88802075ab38 (&f->f_owner.lock){...-}-{2:2}, at: send_sigio+0x2f/0x330 fs/fcntl.c:796

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-> (&dev->event_lock#2){-...}-{2:2} {
IN-HARDIRQ-W at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
input_event+0x8a/0xd0 drivers/input/input.c:456
input_report_key include/linux/input.h:425 [inline]
psmouse_report_standard_buttons drivers/input/mouse/psmouse-base.c:123 [inline]
psmouse_report_standard_packet+0x50/0x200 drivers/input/mouse/psmouse-base.c:141
psmouse_process_byte+0x45b/0x640 drivers/input/mouse/psmouse-base.c:232
psmouse_handle_byte+0x46/0x4b0 drivers/input/mouse/psmouse-base.c:274
psmouse_interrupt+0x697/0x10a0 drivers/input/mouse/psmouse-base.c:426
serio_interrupt+0x88/0x130 drivers/input/serio/serio.c:1001
i8042_interrupt+0x355/0x750 drivers/input/serio/i8042.c:606
__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]
i8042_command drivers/input/serio/i8042.c:356 [inline]
i8042_aux_write+0x112/0x190 drivers/input/serio/i8042.c:391
serio_write include/linux/serio.h:125 [inline]
ps2_do_sendbyte+0x20a/0x720 drivers/input/serio/libps2.c:40
ps2_sendbyte+0x5c/0x120 drivers/input/serio/libps2.c:92
cypress_ps2_sendbyte drivers/input/mouse/cypress_ps2.c:42 [inline]
cypress_ps2_read_cmd_status drivers/input/mouse/cypress_ps2.c:116 [inline]
cypress_send_ext_cmd+0x21d/0x900 drivers/input/mouse/cypress_ps2.c:189
cypress_detect+0x8f/0x220 drivers/input/mouse/cypress_ps2.c:205
psmouse_do_detect drivers/input/mouse/psmouse-base.c:1009 [inline]
psmouse_try_protocol drivers/input/mouse/psmouse-base.c:1023 [inline]
psmouse_extensions+0xc2a/0x1550 drivers/input/mouse/psmouse-base.c:1146
psmouse_switch_protocol+0x308/0x840 drivers/input/mouse/psmouse-base.c:1542
psmouse_connect+0x94b/0x1430 drivers/input/mouse/psmouse-base.c:1632
serio_connect_driver drivers/input/serio/serio.c:47 [inline]
serio_driver_probe+0x74/0x90 drivers/input/serio/serio.c:778
really_probe+0x24e/0xb60 drivers/base/dd.c:595
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755
driver_probe_device+0x50/0x420 drivers/base/dd.c:785
__driver_attach+0x479/0x690 drivers/base/dd.c:1164
bus_for_each_dev+0x17c/0x1f0 drivers/base/bus.c:301
serio_attach_driver drivers/input/serio/serio.c:807 [inline]
serio_handle_event+0x56a/0x8f0 drivers/input/serio/serio.c:227
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
INITIAL USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
input_inject_event+0xc0/0x300 drivers/input/input.c:482
led_trigger_event+0x64/0xc0 drivers/leds/led-triggers.c:388
kbd_led_trigger_activate+0xb9/0x100 drivers/tty/vt/keyboard.c:1029
led_trigger_set+0x513/0x930 drivers/leds/led-triggers.c:195
led_trigger_set_default+0x1c2/0x200 drivers/leds/led-triggers.c:259
led_classdev_register_ext+0x6cf/0x8d0 drivers/leds/led-class.c:421
led_classdev_register include/linux/leds.h:196 [inline]
input_leds_connect+0x503/0x740 drivers/input/input-leds.c:139
input_attach_handler drivers/input/input.c:1046 [inline]
input_register_device+0xdae/0x1150 drivers/input/input.c:2354
atkbd_connect+0x7a7/0xa70 drivers/input/keyboard/atkbd.c:1293
serio_connect_driver drivers/input/serio/serio.c:47 [inline]
serio_driver_probe+0x74/0x90 drivers/input/serio/serio.c:778
really_probe+0x24e/0xb60 drivers/base/dd.c:595
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755
driver_probe_device+0x50/0x420 drivers/base/dd.c:785
__driver_attach+0x479/0x690 drivers/base/dd.c:1164
bus_for_each_dev+0x17c/0x1f0 drivers/base/bus.c:301
serio_attach_driver drivers/input/serio/serio.c:807 [inline]
serio_handle_event+0x56a/0x8f0 drivers/input/serio/serio.c:227
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
}
... key at: [<ffffffff91735600>] input_allocate_device.__key.6+0x0/0x20
-> (&client->buffer_lock){....}-{2:2} {
INITIAL USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:363 [inline]
evdev_pass_values+0xe7/0xb60 drivers/input/evdev.c:261
evdev_events+0x198/0x2c0 drivers/input/evdev.c:306
input_to_handler drivers/input/input.c:126 [inline]
input_pass_values+0x873/0x1200 drivers/input/input.c:156
input_handle_event+0xc9b/0x1600 drivers/input/input.c:415
input_inject_event+0x1fc/0x300 drivers/input/input.c:487
evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
vfs_write+0x30c/0xe50 fs/read_write.c:592
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
}
... key at: [<ffffffff917358c0>] evdev_open.__key.23+0x0/0x20
... acquired at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:363 [inline]
evdev_pass_values+0xe7/0xb60 drivers/input/evdev.c:261
evdev_events+0x198/0x2c0 drivers/input/evdev.c:306
input_to_handler drivers/input/input.c:126 [inline]
input_pass_values+0x873/0x1200 drivers/input/input.c:156
input_handle_event+0xc9b/0x1600 drivers/input/input.c:415
input_inject_event+0x1fc/0x300 drivers/input/input.c:487
evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
vfs_write+0x30c/0xe50 fs/read_write.c:592
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

-> (&new->fa_lock){....}-{2:2} {
INITIAL USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_write_lock_irq include/linux/rwlock_api_smp.h:196 [inline]
_raw_write_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:316
fasync_remove_entry+0xfb/0x1d0 fs/fcntl.c:891
__fput+0x715/0x890 fs/file_table.c:277
task_work_run+0x129/0x1a0 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:175
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x61/0xcb
INITIAL READ USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
kill_fasync_rcu fs/fcntl.c:1014 [inline]
kill_fasync+0x16a/0x490 fs/fcntl.c:1035
__pass_event drivers/input/evdev.c:240 [inline]
evdev_pass_values+0x5ad/0xb60 drivers/input/evdev.c:278
evdev_events+0x198/0x2c0 drivers/input/evdev.c:306
input_to_handler drivers/input/input.c:126 [inline]
input_pass_values+0x873/0x1200 drivers/input/input.c:156
input_handle_event+0xc9b/0x1600 drivers/input/input.c:415
input_inject_event+0x1fc/0x300 drivers/input/input.c:487
evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
vfs_write+0x30c/0xe50 fs/read_write.c:592
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
}
... key at: [<ffffffff91431d00>] fasync_insert_entry.__key+0x0/0x20
... acquired at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
kill_fasync_rcu fs/fcntl.c:1014 [inline]
kill_fasync+0x16a/0x490 fs/fcntl.c:1035
__pass_event drivers/input/evdev.c:240 [inline]
evdev_pass_values+0x5ad/0xb60 drivers/input/evdev.c:278
evdev_events+0x198/0x2c0 drivers/input/evdev.c:306
input_to_handler drivers/input/input.c:126 [inline]
input_pass_values+0x873/0x1200 drivers/input/input.c:156
input_handle_event+0xc9b/0x1600 drivers/input/input.c:415
input_inject_event+0x1fc/0x300 drivers/input/input.c:487
evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
vfs_write+0x30c/0xe50 fs/read_write.c:592
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

-> (&f->f_owner.lock){...-}-{2:2} {
IN-SOFTIRQ-R at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
send_sigurg+0x25/0x380 fs/fcntl.c:835
sk_send_sigurg+0x6a/0xb0 net/core/sock.c:3094
tcp_check_urg net/ipv4/tcp_input.c:5586 [inline]
tcp_urg+0x2b8/0xb40 net/ipv4/tcp_input.c:5627
tcp_rcv_established+0xe33/0x1e20 net/ipv4/tcp_input.c:5961
tcp_v4_do_rcv+0x423/0x960 net/ipv4/tcp_ipv4.c:1727
tcp_v4_rcv+0x2740/0x2d80 net/ipv4/tcp_ipv4.c:2129
ip_protocol_deliver_rcu+0x381/0x730 net/ipv4/ip_input.c:204
ip_local_deliver_finish+0x1db/0x320 net/ipv4/ip_input.c:231
NF_HOOK+0x364/0x410 include/linux/netfilter.h:302
NF_HOOK+0x364/0x410 include/linux/netfilter.h:302
__netif_receive_skb_one_core net/core/dev.c:5462 [inline]
__netif_receive_skb+0x1c6/0x530 net/core/dev.c:5576
process_backlog+0x363/0x7f0 net/core/dev.c:6453
__napi_poll+0xc7/0x440 net/core/dev.c:7012
napi_poll net/core/dev.c:7079 [inline]
net_rx_action+0x617/0xda0 net/core/dev.c:7166
__do_softirq+0x3b3/0x93a kernel/softirq.c:558
run_ksoftirqd+0xc1/0x120 kernel/softirq.c:920
smpboot_thread_fn+0x51b/0x9d0 kernel/smpboot.c:164
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
INITIAL USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_write_lock_irq include/linux/rwlock_api_smp.h:196 [inline]
_raw_write_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:316
f_modown+0x38/0x340 fs/fcntl.c:91
__f_setown fs/fcntl.c:110 [inline]
f_setown+0x127/0x1d0 fs/fcntl.c:138
do_fcntl+0x1b7/0x1600 fs/fcntl.c:393
__do_sys_fcntl fs/fcntl.c:472 [inline]
__se_sys_fcntl+0xd8/0x1b0 fs/fcntl.c:457
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 READ USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irq include/linux/rwlock_api_smp.h:169 [inline]
_raw_read_lock_irq+0xd6/0x120 kernel/locking/spinlock.c:244
f_getown+0x22/0x240 fs/fcntl.c:154
sock_ioctl+0x3ee/0x770 net/socket.c:1185
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
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
}
... key at: [<ffffffff91431080>] __alloc_file.__key+0x0/0x10
... acquired at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
send_sigio+0x2f/0x330 fs/fcntl.c:796
kill_fasync_rcu fs/fcntl.c:1021 [inline]
kill_fasync+0x20c/0x490 fs/fcntl.c:1035
__pass_event drivers/input/evdev.c:240 [inline]
evdev_pass_values+0x5ad/0xb60 drivers/input/evdev.c:278
evdev_events+0x198/0x2c0 drivers/input/evdev.c:306
input_to_handler drivers/input/input.c:126 [inline]
input_pass_values+0x873/0x1200 drivers/input/input.c:156
input_handle_event+0xc9b/0x1600 drivers/input/input.c:415
input_inject_event+0x1fc/0x300 drivers/input/input.c:487
evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
vfs_write+0x30c/0xe50 fs/read_write.c:592
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


the dependencies between the lock to be acquired
and HARDIRQ-irq-unsafe lock:
-> (tasklist_lock){.+.+}-{2:2} {
HARDIRQ-ON-R at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
do_wait+0x2a7/0xaf0 kernel/exit.c:1576
kernel_wait+0xe5/0x230 kernel/exit.c:1766
call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:166
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
SOFTIRQ-ON-R at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
do_wait+0x2a7/0xaf0 kernel/exit.c:1576
kernel_wait+0xe5/0x230 kernel/exit.c:1766
call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:166
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
INITIAL USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_write_lock_irq include/linux/rwlock_api_smp.h:196 [inline]
_raw_write_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:316
copy_process+0x22be/0x3ef0 kernel/fork.c:2329
kernel_clone+0x210/0x960 kernel/fork.c:2601
kernel_thread+0x168/0x1e0 kernel/fork.c:2653
rest_init+0x21/0x330 init/main.c:701
start_kernel+0x491/0x53a init/main.c:1144
secondary_startup_64_no_verify+0xb1/0xbb
INITIAL READ USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
do_wait+0x2a7/0xaf0 kernel/exit.c:1576
kernel_wait+0xe5/0x230 kernel/exit.c:1766
call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:166
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
}
... key at: [<ffffffff8c60a058>] tasklist_lock+0x18/0x40
... acquired at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
send_sigio+0xd2/0x330 fs/fcntl.c:810
dnotify_handle_event+0x138/0x440 fs/notify/dnotify/dnotify.c:97
fsnotify_handle_inode_event fs/notify/fsnotify.c:263 [inline]
fsnotify_handle_event fs/notify/fsnotify.c:310 [inline]
send_to_group fs/notify/fsnotify.c:364 [inline]
fsnotify+0x18c2/0x1fa0 fs/notify/fsnotify.c:541
fsnotify_name include/linux/fsnotify.h:36 [inline]
fsnotify_dirent include/linux/fsnotify.h:42 [inline]
fsnotify_create include/linux/fsnotify.h:198 [inline]
open_last_lookups fs/namei.c:3464 [inline]
path_openat+0x14f8/0x2f20 fs/namei.c:3669
do_filp_open+0x21c/0x460 fs/namei.c:3699
do_sys_openat2+0x13b/0x500 fs/open.c:1211
do_sys_open fs/open.c:1227 [inline]
__do_sys_openat fs/open.c:1243 [inline]
__se_sys_openat fs/open.c:1238 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1238
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: 0 PID: 8494 Comm: syz-executor.4 Not tainted 5.15.120-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
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+0x4cfe/0x58b0 kernel/locking/lockdep.c:3787
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
send_sigio+0xd2/0x330 fs/fcntl.c:810
dnotify_handle_event+0x138/0x440 fs/notify/dnotify/dnotify.c:97
fsnotify_handle_inode_event fs/notify/fsnotify.c:263 [inline]
fsnotify_handle_event fs/notify/fsnotify.c:310 [inline]
send_to_group fs/notify/fsnotify.c:364 [inline]
fsnotify+0x18c2/0x1fa0 fs/notify/fsnotify.c:541
fsnotify_name include/linux/fsnotify.h:36 [inline]
fsnotify_dirent include/linux/fsnotify.h:42 [inline]
fsnotify_create include/linux/fsnotify.h:198 [inline]
open_last_lookups fs/namei.c:3464 [inline]
path_openat+0x14f8/0x2f20 fs/namei.c:3669
do_filp_open+0x21c/0x460 fs/namei.c:3699
do_sys_openat2+0x13b/0x500 fs/open.c:1211
do_sys_open fs/open.c:1227 [inline]
__do_sys_openat fs/open.c:1243 [inline]
__se_sys_openat fs/open.c:1238 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1238
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:0x7f7773e4db29
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:00007f77723cf0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f7773f6cf80 RCX: 00007f7773e4db29
RDX: 0000000000020040 RSI: 0000000020001340 RDI: ffffffffffffff9c
RBP: 00007f7773e9947a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f7773f6cf80 R15: 00007ffcac503748
</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 bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

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

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

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

syzbot

unread,
Jul 19, 2023, 4:21:57 AM7/19/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: d54cfc420586 Linux 5.15.120
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17684d92a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=f546a5c7ff981a94
dashboard link: https://syzkaller.appspot.com/bug?extid=2f5570a645018de96979
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15abeba2a80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=155c3a01a80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/601dfce79849/disk-d54cfc42.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b8e802138c25/vmlinux-d54cfc42.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9b3b48ff5c05/bzImage-d54cfc42.xz

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

=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
5.15.120-syzkaller #0 Not tainted
-----------------------------------------------------
syz-executor748/3498 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffff8880704160c0 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1014 [inline]
ffff8880704160c0 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0x16a/0x490 fs/fcntl.c:1035

and this task is already holding:
ffff88814ad20028 (&client->buffer_lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
ffff88814ad20028 (&client->buffer_lock){....}-{2:2}, at: evdev_pass_values+0xe7/0xb60 drivers/input/evdev.c:261
which would create a new lock dependency:
(&client->buffer_lock){....}-{2:2} -> (&new->fa_lock){....}-{2:2}

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

... which became HARDIRQ-irq-safe at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
input_event+0x8a/0xd0 drivers/input/input.c:456
input_report_key include/linux/input.h:425 [inline]
psmouse_report_standard_buttons drivers/input/mouse/psmouse-base.c:123 [inline]
psmouse_report_standard_packet+0x50/0x200 drivers/input/mouse/psmouse-base.c:141
psmouse_process_byte+0x45b/0x640 drivers/input/mouse/psmouse-base.c:232
psmouse_handle_byte+0x46/0x4b0 drivers/input/mouse/psmouse-base.c:274
psmouse_interrupt+0x697/0x10a0 drivers/input/mouse/psmouse-base.c:426
serio_interrupt+0x88/0x130 drivers/input/serio/serio.c:1001
i8042_interrupt+0x355/0x750 drivers/input/serio/i8042.c:606
__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
__preempt_count_dec_and_test arch/x86/include/asm/preempt.h:95 [inline]
rcu_is_watching+0x63/0xa0 kernel/rcu/tree.c:1123
trace_lock_release include/trace/events/lock.h:58 [inline]
lock_release+0xb9/0x9a0 kernel/locking/lockdep.c:5633
__raw_spin_unlock include/linux/spinlock_api_smp.h:150 [inline]
_raw_spin_unlock+0x12/0x40 kernel/locking/spinlock.c:186
usb_device_match+0x4ca/0x560 drivers/usb/core/driver.c:893
driver_match_device drivers/base/base.h:147 [inline]
__driver_attach+0x66/0x690 drivers/base/dd.c:1120
bus_for_each_dev+0x17c/0x1f0 drivers/base/bus.c:301
bus_add_driver+0x334/0x600 drivers/base/bus.c:618
driver_register+0x2bf/0x3a0 drivers/base/driver.c:171
usb_register_driver+0x206/0x3d0 drivers/usb/core/driver.c:1061
do_one_initcall+0x22b/0x7a0 init/main.c:1306
do_initcall_level+0x157/0x207 init/main.c:1379
do_initcalls+0x49/0x86 init/main.c:1395
kernel_init_freeable+0x43c/0x5c5 init/main.c:1619
kernel_init+0x19/0x290 init/main.c:1510
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

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

... which became HARDIRQ-irq-unsafe at:
...
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
do_wait+0x2a7/0xaf0 kernel/exit.c:1576
kernel_wait+0xe5/0x230 kernel/exit.c:1766
call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:166
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

other info that might help us debug this:

Chain exists of:
&dev->event_lock#2 --> &client->buffer_lock --> tasklist_lock

Possible interrupt unsafe locking scenario:

CPU0 CPU1
---- ----
lock(tasklist_lock);
local_irq_disable();
lock(&dev->event_lock#2);
lock(&client->buffer_lock);
<Interrupt>
lock(&dev->event_lock#2);

*** DEADLOCK ***

7 locks held by syz-executor748/3498:
#0: ffff888148179110 (&evdev->mutex){+.+.}-{3:3}, at: evdev_write+0x26d/0x7c0 drivers/input/evdev.c:513
#1: ffff88801979a230 (&dev->event_lock#2){-...}-{2:2}, at: input_inject_event+0xc0/0x300 drivers/input/input.c:482
#2: ffffffff8c91e6a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:268
#3: ffffffff8c91e6a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:268
#4: ffffffff8c91e6a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:268
#5: ffff88814ad20028 (&client->buffer_lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
#5: ffff88814ad20028 (&client->buffer_lock){....}-{2:2}, at: evdev_pass_values+0xe7/0xb60 drivers/input/evdev.c:261
#6: ffffffff8c91e6a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:268

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-> (&dev->event_lock#2){-...}-{2:2} {
IN-HARDIRQ-W at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
input_event+0x8a/0xd0 drivers/input/input.c:456
input_report_key include/linux/input.h:425 [inline]
psmouse_report_standard_buttons drivers/input/mouse/psmouse-base.c:123 [inline]
psmouse_report_standard_packet+0x50/0x200 drivers/input/mouse/psmouse-base.c:141
psmouse_process_byte+0x45b/0x640 drivers/input/mouse/psmouse-base.c:232
psmouse_handle_byte+0x46/0x4b0 drivers/input/mouse/psmouse-base.c:274
psmouse_interrupt+0x697/0x10a0 drivers/input/mouse/psmouse-base.c:426
serio_interrupt+0x88/0x130 drivers/input/serio/serio.c:1001
i8042_interrupt+0x355/0x750 drivers/input/serio/i8042.c:606
__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
__preempt_count_dec_and_test arch/x86/include/asm/preempt.h:95 [inline]
rcu_is_watching+0x63/0xa0 kernel/rcu/tree.c:1123
trace_lock_release include/trace/events/lock.h:58 [inline]
lock_release+0xb9/0x9a0 kernel/locking/lockdep.c:5633
__raw_spin_unlock include/linux/spinlock_api_smp.h:150 [inline]
_raw_spin_unlock+0x12/0x40 kernel/locking/spinlock.c:186
usb_device_match+0x4ca/0x560 drivers/usb/core/driver.c:893
driver_match_device drivers/base/base.h:147 [inline]
__driver_attach+0x66/0x690 drivers/base/dd.c:1120
bus_for_each_dev+0x17c/0x1f0 drivers/base/bus.c:301
bus_add_driver+0x334/0x600 drivers/base/bus.c:618
driver_register+0x2bf/0x3a0 drivers/base/driver.c:171
usb_register_driver+0x206/0x3d0 drivers/usb/core/driver.c:1061
do_one_initcall+0x22b/0x7a0 init/main.c:1306
do_initcall_level+0x157/0x207 init/main.c:1379
do_initcalls+0x49/0x86 init/main.c:1395
kernel_init_freeable+0x43c/0x5c5 init/main.c:1619
kernel_init+0x19/0x290 init/main.c:1510
kill_fasync_rcu fs/fcntl.c:1021 [inline]
kill_fasync+0x20c/0x490 fs/fcntl.c:1035
lease_break_callback+0x22/0x30 fs/locks.c:585
__break_lease+0x4d1/0x13b0 fs/locks.c:1560
break_lease include/linux/fs.h:2576 [inline]
do_dentry_open+0x77a/0xfb0 fs/open.c:817
do_open fs/namei.c:3538 [inline]
path_openat+0x2702/0x2f20 fs/namei.c:3672
do_filp_open+0x21c/0x460 fs/namei.c:3699
do_sys_openat2+0x13b/0x500 fs/open.c:1211
do_sys_open fs/open.c:1227 [inline]
__do_sys_open fs/open.c:1235 [inline]
__se_sys_open fs/open.c:1231 [inline]
__x64_sys_open+0x221/0x270 fs/open.c:1231
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

-> (&f->f_owner.lock){....}-{2:2} {
INITIAL USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_write_lock_irq include/linux/rwlock_api_smp.h:196 [inline]
_raw_write_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:316
f_modown+0x38/0x340 fs/fcntl.c:91
__f_setown fs/fcntl.c:110 [inline]
f_setown_ex fs/fcntl.c:200 [inline]
do_fcntl+0x1253/0x1600 fs/fcntl.c:399
__do_sys_fcntl fs/fcntl.c:472 [inline]
__se_sys_fcntl+0xd8/0x1b0 fs/fcntl.c:457
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 READ USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
send_sigio+0x2f/0x330 fs/fcntl.c:796
kill_fasync_rcu fs/fcntl.c:1021 [inline]
kill_fasync+0x20c/0x490 fs/fcntl.c:1035
lease_break_callback+0x22/0x30 fs/locks.c:585
__break_lease+0x4d1/0x13b0 fs/locks.c:1560
break_lease include/linux/fs.h:2576 [inline]
do_dentry_open+0x77a/0xfb0 fs/open.c:817
do_open fs/namei.c:3538 [inline]
path_openat+0x2702/0x2f20 fs/namei.c:3672
do_filp_open+0x21c/0x460 fs/namei.c:3699
do_sys_openat2+0x13b/0x500 fs/open.c:1211
do_sys_open fs/open.c:1227 [inline]
__do_sys_open fs/open.c:1235 [inline]
__se_sys_open fs/open.c:1231 [inline]
__x64_sys_open+0x221/0x270 fs/open.c:1231
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
}
... key at: [<ffffffff91431080>] __alloc_file.__key+0x0/0x10
... acquired at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
send_sigio+0x2f/0x330 fs/fcntl.c:796
kill_fasync_rcu fs/fcntl.c:1021 [inline]
kill_fasync+0x20c/0x490 fs/fcntl.c:1035
lease_break_callback+0x22/0x30 fs/locks.c:585
__break_lease+0x4d1/0x13b0 fs/locks.c:1560
break_lease include/linux/fs.h:2576 [inline]
do_dentry_open+0x77a/0xfb0 fs/open.c:817
do_open fs/namei.c:3538 [inline]
path_openat+0x2702/0x2f20 fs/namei.c:3672
do_filp_open+0x21c/0x460 fs/namei.c:3699
do_sys_openat2+0x13b/0x500 fs/open.c:1211
do_sys_open fs/open.c:1227 [inline]
__do_sys_open fs/open.c:1235 [inline]
__se_sys_open fs/open.c:1231 [inline]
__x64_sys_open+0x221/0x270 fs/open.c:1231
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

-> (&new->fa_lock){....}-{2:2} {
INITIAL READ USE at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
kill_fasync_rcu fs/fcntl.c:1014 [inline]
kill_fasync+0x16a/0x490 fs/fcntl.c:1035
lease_break_callback+0x22/0x30 fs/locks.c:585
__break_lease+0x4d1/0x13b0 fs/locks.c:1560
break_lease include/linux/fs.h:2576 [inline]
do_dentry_open+0x77a/0xfb0 fs/open.c:817
do_open fs/namei.c:3538 [inline]
path_openat+0x2702/0x2f20 fs/namei.c:3672
do_filp_open+0x21c/0x460 fs/namei.c:3699
do_sys_openat2+0x13b/0x500 fs/open.c:1211
do_sys_open fs/open.c:1227 [inline]
__do_sys_open fs/open.c:1235 [inline]
__se_sys_open fs/open.c:1231 [inline]
__x64_sys_open+0x221/0x270 fs/open.c:1231
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
}
... key at: [<ffffffff91431d00>] fasync_insert_entry.__key+0x0/0x20
... acquired at:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
kill_fasync_rcu fs/fcntl.c:1014 [inline]
kill_fasync+0x16a/0x490 fs/fcntl.c:1035
__pass_event drivers/input/evdev.c:240 [inline]
evdev_pass_values+0x5ad/0xb60 drivers/input/evdev.c:278
evdev_events+0x198/0x2c0 drivers/input/evdev.c:306
input_to_handler drivers/input/input.c:126 [inline]
input_pass_values+0x873/0x1200 drivers/input/input.c:156
input_handle_event+0xc9b/0x1600 drivers/input/input.c:415
input_inject_event+0x1fc/0x300 drivers/input/input.c:487
evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
vfs_write+0x30c/0xe50 fs/read_write.c:592
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: 0 PID: 3498 Comm: syz-executor748 Not tainted 5.15.120-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
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+0x4cfe/0x58b0 kernel/locking/lockdep.c:3787
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline]
_raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
kill_fasync_rcu fs/fcntl.c:1014 [inline]
kill_fasync+0x16a/0x490 fs/fcntl.c:1035
__pass_event drivers/input/evdev.c:240 [inline]
evdev_pass_values+0x5ad/0xb60 drivers/input/evdev.c:278
evdev_events+0x198/0x2c0 drivers/input/evdev.c:306
input_to_handler drivers/input/input.c:126 [inline]
input_pass_values+0x873/0x1200 drivers/input/input.c:156
input_handle_event+0xc9b/0x1600 drivers/input/input.c:415
input_inject_event+0x1fc/0x300 drivers/input/input.c:487
evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
vfs_write+0x30c/0xe50 fs/read_write.c:592
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:0x7f8764d14bb9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 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:00007f8764cd4228 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f8764d9b348 RCX: 00007f8764d14bb9
RDX: 0000000000000079 RSI: 000000002004d000 RDI: 0000000000000005
RBP: 00007f8764d9b340 R08: 00007f8764cd46c0 R09: 00007f8764cd46c0
R10: 00007f8764cd46c0 R11: 000000


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages