diff options
| author | Yonatan Nachum <ynachum@amazon.com> | 2026-10-12 16:51:13 +0000 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2026-10-13 07:25:10 -0400 |
| commit | 466612f8a8020c6b3af6377c730775a4c630f12c (patch) | |
| tree | 3320f6712e3d69044461c8e2b2d1273dc195af82 /tools/lib/python/kdoc/python_version.py | |
| parent | f74eac4fc6c56274fb96c2c44ffad8f01c325f17 (diff) | |
RDMA/efa: Fix race between admin command timeout and completion
An admin command that times out can race with the interrupt handler
processing its completion, in two ways.
The timeout path releases the completion context without synchronizing
against the handler. A handler that has already seen the command as
submitted then copies the CQE into the caller's response buffer after
the waiter returned and that buffer went out of scope.
The waiter can also observe the command as completed before the CQE was
copied, since the status is published first. It decodes its own
uninitialized response buffer, returns success with garbage contents and
leaks stack data to the caller. Both wait paths read the status without
the CQ lock.
Add a timed-out state and publish it under the CQ lock in both wait
paths before returning, so the handler, which only completes commands in
submitted state, cannot act on an abandoned context. In the interrupt
wait path test the return value of the wait instead of the status: the
handler signals the completion after copying the CQE, so a successful
wait implies a valid response. Read the status in the polling wait path
inside the critical section that drains the CQ, which also lets a
completion arriving on the last iteration be honored instead of reported
as a timeout.
Fixes: 0420e542569b ("RDMA/efa: Implement functions that submit and complete admin commands")
Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Tom Sela <tomsela@amazon.com>
Signed-off-by: Yonatan Nachum <ynachum@amazon.com>
Link: https://patch.msgid.link/20261012165113.576899-1-ynachum@amazon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
