Skip to content

fix potential discarding of events by read events

Kent Gibson linux-gpio 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v12 patches 1 replySuperseded

Changes in v2 from the cover letter

- restored usleep() when creating multiple events in patch 1.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tests: event: reading test coverage extended to cover reading a subset of available eventstests/tests-event.c+137 -200 replies
2/2core: fix reading subset of available eventslib/core.c+4 -15 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [libgpiod][PATCH v2 0/2] fix potential discarding of events by read events

This patch set addresses a bug where reading events can quietly discard events. The problem occurs any time a request made is for a number of events that differs from the number available at the time - a number that userspace is unaware of.

The problem is due to the read multiple always reading up to 16 events from the kernel - independent of how many events have been requested.

The problem applies to reading both single and multiple events, as the single event read implementation wraps the multiple.

The first patch extends test coverage to highlight the problem. The second fixes the bug.

Changes for v2:
- restored usleep() when creating multiple events in patch 1.

Kent Gibson (2):
tests: event: reading test coverage extended to cover reading a subset
of available events
core: fix reading subset of available events

 lib/core.c          |   5 +-
 tests/tests-event.c | 157 ++++++++++++++++++++++++++++++++++++++------
 2 files changed, 141 insertions(+), 21 deletions(-)

base-commit: fc61e740fcbe3c6594295766759888c96c45bd29

Signature · 1 line
2.28.0