Skip to content

HID: debug: fix the ring buffer implementation

Vladis Dronov linux-input lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3HID: debug: avoid infinite loop and corrupting datadrivers/hid/hid-debug.c+65 -440 replies
2/3HID: debug: provide reader-writer locking for the ring bufferdrivers/hid/hid-debug.c include/linux/hid-debug.h+30 -190 replies
3/3HID: debug: fix the ring buffer writer implementationdrivers/hid/hid-debug.c+58 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] HID: debug: fix the ring buffer implementation

This patchset is fixing some aspects of the ring buffer implementation in drivers/hid/hid-debug.c. This implementation has certain problem points:

- it may stuck in an infinite loop
- it may return corrupted data
- a reader and a writer are not protected by spinlocks, which can lead to the corrupted data

The suggested patchset is a new ring buffer implementation which overwrites the oldest data in case of an overflow. One can verify the suggested ring buffer implementation by fuzzing it with modified kernel and fuzzer-reader
at: https://gist.github.com/nefigtut/33d56e3870b67493cc867344aed2a062

Vladis Dronov (3):
HID: debug: avoid infinite loop and corrupting data
HID: debug: provide reader-writer locking for the ring buffer
HID: debug: fix ring buffer implementation

 drivers/hid/hid-debug.c   | 201 ++++++++++++++++++++++++++------------
 include/linux/hid-debug.h |   1 +
 2 files changed, 142 insertions(+), 60 deletions(-)
Signature · 1 line
2.19.0