dd2cd44368
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.