Re: [PATCH v3] HID: debug: fix the ring buffer implementation

2019-01-29 Thread Benjamin Tissoires
On Tue, Jan 29, 2019 at 11:58 AM Vladis Dronov wrote: > > Ring buffer implementation in hid_debug_event() and hid_debug_events_read() > is strange allowing lost or corrupted data. After commit 717adfdaf147 > ("HID: debug: check length before copy_to_user()") it is possible to enter > an infinite l

[PATCH v3] HID: debug: fix the ring buffer implementation

2019-01-29 Thread Vladis Dronov
Ring buffer implementation in hid_debug_event() and hid_debug_events_read() is strange allowing lost or corrupted data. After commit 717adfdaf147 ("HID: debug: check length before copy_to_user()") it is possible to enter an infinite loop in hid_debug_events_read() by providing 0 as count, this lock