Re: [PATCH v2] Input: evdev - Flush queues during EVIOCGKEY-like ioctls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux