Commit ab9b07d
Brian Foster
pipe: wakeup wr_wait after setting max_usage
Upstream Status: linux.git
JIRA: https://issues.redhat.com/browse/RHEL-37087
CVE: CVE-2023-52672
commit e95aada
Author: Lukas Schauer <lukas@schauer.dev>
Date: Fri Dec 1 11:11:28 2023 +0100
pipe: wakeup wr_wait after setting max_usage
Commit c73be61 ("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.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=212295 [1]
Link: https://lore.kernel.org/r/20231201-orchideen-modewelt-e009de4562c6@brauner
Fixes: c73be61 ("pipe: Add general notification queue support")
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Lukas Schauer <lukas@schauer.dev>
[Christian Brauner <brauner@kernel.org>: rewrite to account for watch queues]
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Brian Foster <bfoster@redhat.com>1 parent 1aa74b1 commit ab9b07d
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1313 | 1313 | | |
1314 | 1314 | | |
1315 | 1315 | | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
1316 | 1321 | | |
1317 | 1322 | | |
1318 | 1323 | | |
| |||
1364 | 1369 | | |
1365 | 1370 | | |
1366 | 1371 | | |
1367 | | - | |
1368 | | - | |
1369 | 1372 | | |
1370 | 1373 | | |
1371 | 1374 | | |
| |||
0 commit comments