CVE-2023-53539: RDMA/rxe: Fix incomplete state save in rxe_requester
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
RDMA/rxe: Fix incomplete state save in rxe_requester
If a send packet is dropped by the IP layer in rxe_requester() the call to rxe_xmit_packet() can fail with err == -EAGAIN. To recover, the state of the wqe is restored to the state before the packet was sent so it can be resent. However, the routines that save and restore the state miss a significnt part of the variable state in the wqe, the dma struct which is used to process through the sge table. And, the state is not saved before the packet is built which modifies the dma struct.
Under heavy stress testing with many QPs on a fast node sending large messages to a slow node dropped packets are observed and the resent packets are corrupted because the dma struct was not restored. This patch fixes this behavior and allows the test cases to succeed.
The Linux kernel CVE team has assigned CVE-2023-53539 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.8 with commit 3050b99850247695cb07a5c15265afcc08bcf400 and fixed in 6.1.53 with commit 70518f3aaf5a059b691867d7d2d46b999319656a Issue introduced in 4.8 with commit 3050b99850247695cb07a5c15265afcc08bcf400 and fixed in 6.4.16 with commit 2f2a6422287fe29f9343247d77b645100ece0652 Issue introduced in 4.8 with commit 3050b99850247695cb07a5c15265afcc08bcf400 and fixed in 6.5.3 with commit 255c0e60e1d16874fc151358d94bc8df661600dd Issue introduced in 4.8 with commit 3050b99850247695cb07a5c15265afcc08bcf400 and fixed in 6.6 with commit 5d122db2ff80cd2aed4dcd630befb56b51ddf947
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2023-53539
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/infiniband/sw/rxe/rxe_req.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/70518f3aaf5a059b691867d7d2d46b999319656a https://git.kernel.org/stable/c/2f2a6422287fe29f9343247d77b645100ece0652 https://git.kernel.org/stable/c/255c0e60e1d16874fc151358d94bc8df661600dd https://git.kernel.org/stable/c/5d122db2ff80cd2aed4dcd630befb56b51ddf947