In the Linux kernel, the following vulnerability has been resolved:
nvme-rdma: fix -EIO cleanup order in queue_rq
On -EIO, the RDMA queue_rq path reports a host path error and then
still cleans up the command and unmaps the SQE DMA. The path error
helper completes the request, so that is double cleanup and DMA unmap
after the request is already complete.
Unmap the SQE first, then report the host path error. Skip the outer
command cleanup on that path.
CVSS Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7
AV:L - The bug is in the -EIO error path of nvme_rdma_queue_rq(), reached when a local user submits block I/O to an nvme-rdma namespace. The -EIO comes from ib_dma_map_sg() failing in nvme_rdma_dma_map_req() or from the HCA's internal-error state in ib_post_send(). The NVMe-oF target sends no data that causes it, so the vector is local.
AC:H - The path needs a DMA mapping failure or an mlx4/mlx5 HCA in MLX*_DEVICE_STATE_INTERNAL_ERROR, which the attacker can't cause on demand. Turning the second nvme_cleanup_cmd()/sqe unmap into corruption also needs the freed tag to be reused (for example by a discard with RQF_SPECIAL_PAYLOAD) between completion and the stale cleanup.
PR:L - The attacker only needs to issue ordinary I/O, including discards, to a filesystem or block device backed by an nvme-rdma namespace. An unprivileged user with write access can do that. Setting up the NVMe-oF connection is an admin step the attacker does not need to perform.
UI:N - No victim action is needed; the attacker's own I/O submissions drive nvme_rdma_queue_rq() into the failing path.
S:U - The corruption hits host kernel memory and the host's own DMA mappings, inside the kernel's security authority. No guest, IOMMU or sandbox boundary is crossed.
C:H - nvme_host_path_error() completes the request and may free its tag. The later nvme_cleanup_cmd() can then kfree() the special_vec range buffer of a request that reused the tag (a use-after-free), and ib_dma_unmap_single() can tear down another request's sqe mapping. Both are memory-corruption primitives that could leak data.
I:H - Freeing a live discard range buffer and unmapping a reused request's command DMA mapping lets freed memory be reallocated while the HCA or driver still uses it. That can corrupt kernel heap objects or change the NVMe command sent to the target.
A:H - The double cleanup of a completed or requeued request can cause a double kfree, a DMA-unmap fault or a KASAN/oops, which crashes the host kernel.
| Attack Vector |
Local |
Scope |
Unchanged |
| Attack Complexity |
High |
Confidentiality Impact |
High |
| Privileges Required |
Low |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:L - The bug is in the -EIO error path of nvme_rdma_queue_rq(), reached when a local user submits block I/O to an nvme-rdma namespace. The -EIO comes from ib_dma_map_sg() failing in nvme_rdma_dma_map_req() or from the HCA's internal-error state in ib_post_send(). The NVMe-oF target sends no data that causes it, so the vector is local.
AC:H - The path needs a DMA mapping failure or an mlx4/mlx5 HCA in MLX*_DEVICE_STATE_INTERNAL_ERROR, which the attacker can't cause on demand. Turning the second nvme_cleanup_cmd()/sqe unmap into corruption also needs the freed tag to be reused (for example by a discard with RQF_SPECIAL_PAYLOAD) between completion and the stale cleanup.
PR:L - The attacker only needs to issue ordinary I/O, including discards, to a filesystem or block device backed by an nvme-rdma namespace. An unprivileged user with write access can do that. Setting up the NVMe-oF connection is an admin step the attacker does not need to perform.
UI:N - No victim action is needed; the attacker's own I/O submissions drive nvme_rdma_queue_rq() into the failing path.
S:U - The corruption hits host kernel memory and the host's own DMA mappings, inside the kernel's security authority. No guest, IOMMU or sandbox boundary is crossed.
C:H - nvme_host_path_error() completes the request and may free its tag. The later nvme_cleanup_cmd() can then kfree() the special_vec range buffer of a request that reused the tag (a use-after-free), and ib_dma_unmap_single() can tear down another request's sqe mapping. Both are memory-corruption primitives that could leak data.
I:H - Freeing a live discard range buffer and unmapping a reused request's command DMA mapping lets freed memory be reallocated while the HCA or driver still uses it. That can corrupt kernel heap objects or change the NVMe command sent to the target.
A:H - The double cleanup of a completed or requeued request can cause a double kfree, a DMA-unmap fault or a KASAN/oops, which crashes the host kernel.
CVSS 3.1