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

2019-01-26 Thread Vladis Dronov
Hello, Oleg, all, Thanks much, Oleg, these are really valuable additions: > suspicious ;) if you add a comment the patch will be even better. Great, will do. > perhaps it make sense to move this check into the "if (kfifo_is_empty())" > block. Indeed, otherwise it kinda breaks the execution log

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

2019-01-25 Thread Oleg Nesterov
On 01/25, 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 loop in hid_debug_events_