Re: [PATCH v2] Input: evdev - Flush queues during EVIOCGKEY-like ioctls
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-03-28 05:06:37
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-03-28 05:06:37
On Thu, Mar 28, 2013 at 01:49:24AM +0100, David Herrmann wrote:
+ spin_lock_irq(&dev->event_lock); + spin_lock(&client->buffer_lock); + + ret = bits_to_user(bits, max, size, p, compat);
This copies data to userspace and thus may sleep. You can not hold spinlocks here. I think you need to collect the data, flush the events and then try copying the data out. If we fail on copying data out - too bad. Maybe we can stuff SYN_DROPPED in the queue, but it is not really necessary. Thanks. -- Dmitry