Files
RedBear-OS/src/platform
Red Bear OS dd2cd44368 relibc: epoll_pwait must not panic on EVENT_TIMEOUT_ID
The kernel can inject a synthetic event with id == EVENT_TIMEOUT_ID
when the requested timeout fires. The previous loop iterated the raw
event buffer with events.add(i) (in epoll_event strides) and then
interpreted the result as a syscall::Event, which produced out-of-bounds
reads when the kernel interleaved timeout events with real events.

Two changes:

1. Cast events to Event* first, then add i in Event strides so the
   pointer arithmetic matches the buffer the kernel filled.
2. Filter out entries with id == EVENT_TIMEOUT_ID before copying them
   into the user-visible epoll_event array.

Adds a regression test that builds a synthetic Event buffer with a
timeout entry interleaved and verifies that the timeout entry is
dropped while siblings are preserved.
2026-07-26 16:27:01 +09:00
..
2026-07-15 18:26:27 +10:00
2026-06-21 14:54:58 +07:00
2026-06-20 12:31:32 +07:00
2026-07-16 08:59:10 +01:00
2026-02-08 21:45:15 +00:00
2026-05-20 18:51:53 +07:00