Re: [syzbot] possible deadlock in input_event (2)

From: Jeongjun Park
Date: Sat Apr 20 2024 - 02:15:20 EST


please test deadlock in input_event

#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

---
drivers/input/evdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 51e0c4954600..181c798b232b 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -258,7 +258,7 @@ static void evdev_pass_values(struct evdev_client *client,
event.input_event_usec = ts.tv_nsec / NSEC_PER_USEC;

/* Interrupts are disabled, just acquire the lock. */
- spin_lock(&client->buffer_lock);
+ spin_lock_irq(&client->buffer_lock);

for (v = vals; v != vals + count; v++) {
if (__evdev_is_filtered(client, v->type, v->code))
@@ -278,7 +278,7 @@ static void evdev_pass_values(struct evdev_client *client,
__pass_event(client, &event);
}

- spin_unlock(&client->buffer_lock);
+ spin_unlock_irq(&client->buffer_lock);

if (wakeup)
wake_up_interruptible_poll(&client->wait,
--
2.34.1