pipe: wakeup wr_wait after setting max_usage
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c73be61cede5882f9605a852414db559c0ebedfd · < e95aada4cb93d42e25c30a0ef9eb2923d9711d4a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
pipe: wakeup wr_wait after setting max_usage
Commit c73be61cede5 ("pipe: Add general notification queue support") a regression was introduced that would lock up resized pipes under certain conditions. See the reproducer in [1].
The commit resizing the pipe ring size was moved to a different function, doing that moved the wakeup for pipe->wr_wait before actually raising pipe->max_usage. If a pipe was full before the resize occured it would result in the wakeup never actually triggering pipe_write.
Set @max_usage and @nr_accounted before waking writers if this isn't a watch queue.
[Christian Brauner <brauner@kernel.org>: rewrite to account for watch queues]
From the CVE record · Linux
A Linux kernel regression can leave writers blocked when a full pipe is resized under certain conditions. This can cause the pipe to lock up; the input does not specify authentication requirements or any additional user interaction.
Engineers running Linux kernels with the affected pipe code should check their versions; no affected version range is provided.