io_uring: Fix danger of completion getting reused before being read
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@postgresql.org
Date: 2026-01-15T15:38:43Z
Lists: pgsql-hackers
Attachments
Hi, I privately got a report about a bug in method_io_uring.c: We are calling io_uring_cqe_seen(..., cqe) before reading cqe->res. That allows the completion to be reused, which in turn could lead to cqe->res being overwritten. The window for that is very narrow and the likelihood of it happening is very low, as we should never actually utilize all CQEs, but the consequences would be bad. I plan to push the fix soon-ish. Greetings, Andres Freund
Commits
-
aio: io_uring: Fix danger of completion getting reused before being read
- 7f1b3a4cea56 18.2 landed
- 8077649907d4 19 (unreleased) landed