io_uring/poll: fix signed comparison in io_poll_get_ownership()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a26a35e9019fd70bf3cf647dcfdae87abc7bacea · < 326941b22806cbf2df1fbfe902b7908b368cce42| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
io_uring/poll: fix signed comparison in io_poll_get_ownership()
io_poll_get_ownership() uses a signed comparison to check whether poll_refs has reached the threshold for the slowpath:
if (unlikely(atomic_read(&req->poll_refs) >= IO_POLL_REF_BIAS))
atomic_read() returns int (signed). When IO_POLL_CANCEL_FLAG (BIT(31)) is set in poll_refs, the value becomes negative in signed arithmetic, so the >= 128 comparison always evaluates to false and the slowpath is never taken.
Fix this by casting the atomic_read() result to unsigned int before the comparison, so that the cancel flag is treated as a large positive value and correctly triggers the slowpath.
From the CVE record · Linux
The Linux kernel's io_uring poll code uses a signed comparison that fails to enter the slowpath when the poll cancellation flag is set. This can cause incorrect poll ownership handling; the input does not specify an attacker action, access requirements, or user interaction.
Engineers running Linux kernels with the affected io_uring poll code should check their versions; affected versions are not specified.