Memory Corruption via Uncanceled AIO Requests on Error: libkcapi's one-shot AIO path can return an error before all submitted IOCBs are drained, allowing later kernel writes into caller-owned output buffers.
To mitigate this issue, applications should avoid initializing libkcapi handles with the KCAPI_INIT_AIO flag, preferring synchronous interfaces instead. If the real AIO path must be enabled, applications must ensure that outiov buffers are not immediately freed or reused after an error return, allowing all kernel completions to finish. This operational control prevents delayed kernel writes into potentially reallocated or freed memory.