haitam lazaar / lazaarsec
←Back to all research & writeups
·20 min read·CVE-2026-139415

No Time to Pwn 2: Bypassing RDMA Read Permissions in Linux Soft-iWARP (CVE-2026-139415)

A zero permission mask in the Linux Soft-iWARP (siw) driver let a connected RDMA peer read memory regions registered as write-only. The bug shipped in Linux 5.3 and went unnoticed for seven years. How it worked, how I found it, and how it was fixed upstream.

Topics:#Linux Kernel#Vulnerability Research#RDMA#Networking#CVE#Access Control

TL;DR

A single 0 in Linux's Soft-iWARP driver meant it never checked read permission when answering RDMA READ requests, so any connected peer could read memory an application had registered as write-only. The bug shipped with the driver in Linux 5.3 and survived seven years, because nothing about it ever crashed. Here's how it worked, how I found it, and what getting my first kernel fix upstream taught me.

Summary

CVE-2026-139415 is a missing read-permission check in Soft-iWARP (siw), the Linux kernel’s software implementation of iWARP RDMA. When a remote peer sent an RDMA READ request, siw built the response without checking that the target memory region allowed remote reads. Memory an application had registered as write-only could therefore be read back by a connected peer in the same protection domain. The fix, a few lines in siw_qp_tx.c, requires IB_ACCESS_REMOTE_READ for read responses.

CVECVE-2026-139415
Componentdrivers/infiniband/sw/siw
ClassIncorrect authorization (CWE-863)
AffectedEvery kernel since siw was merged in Linux 5.3 (b9be6f18cf9e)
Fixf74eac4fc6c5, acked by the siw maintainer, backported to stable

Background

I began auditing Linux kernel code in my spare time. My first target was the Maple Tree and VMA subsystem, a relatively recent addition introduced in 2022. It looked promising because of its complex algorithms and data structures, but after several sleepless nights tracing the implementation and its helper libraries, I found nothing genuinely exploitable and moved on.

I paused kernel research when university resumed, but kept reading vulnerability writeups, and one idea from them stuck: code written for special hardware gets far less scrutiny than code anyone can run.

iWARP was designed for RDMA network cards, where enforcing a remote peer’s access rights happens in the adapter. Soft-iWARP moves all of that into a kernel driver: every check the hardware used to make now has to exist, correctly, in C. And because siw needs no special hardware, anyone can load it on a laptop or CI runner and talk to it over plain TCP.

That is the pattern XBOW described in No Time to Pwn for SMC-D: code whose security model assumed hardware becomes ordinary attack surface once it runs in software. siw is that kind of code, so that is where I went looking.

How I Found It

XBOW’s post also shaped how I looked. I used AI-assisted auditing with a human in the loop: the AI did the broad, tedious work of reading through code and surfacing leads, while I chose where to point it, focusing on the parts of the kernel that looked most neglected, and decided which leads deserved a closer look.

Each round of that loop narrowed the attack surface and made the search more precise. Out of the kernel’s neglected corners, Soft-iWARP ended up as one of the few candidates left, and digging into it is what eventually led to the transmit path’s perms = 0. I then confirmed the leak by reproducing it in QEMU.

RDMA and Soft-iWARP

RDMA (Remote Direct Memory Access) lets one host read and write another host’s memory directly. With hardware RDMA, the network card moves the data itself, bypassing the remote host’s kernel and CPU on the data path. That is where its low latency and low CPU overhead come from.

iWARP (Internet Wide-area RDMA Protocol) is the IETF-standardized way to run RDMA over ordinary, routable TCP/IP, instead of InfiniBand or RoCE fabrics. Soft-iWARP (siw, in drivers/infiniband/sw/siw/), written by Bernard Metzler and merged in Linux 5.3, implements the whole iWARP stack in software:

User Space Application (libibverbs / rdma-core) Linux Kernel RDMA Core Subsystem (ib_verbs) DRIVERS/INFINIBAND/SW/SIW (SOFT-iWARP) RDMAP (RFC 5040) — RDMA Read, Write, and Send DDP (RFC 5041) — Direct Data Placement & STags MPA (RFC 5044) — Marker PDU Aligned TCP Framing & CRC32 Standard Linux Network Stack & Ethernet NIC (eth0)
The Soft-iWARP (siw) stack architecture: Translating high-level RDMA verbs into streaming MPA-framed PDUs delivered over standard kernel TCP sockets.
  • siw attaches to an ordinary network interface (such as eth0) and registers an RDMA device (such as siw0).
  • RDMAP, DDP and MPA processing all happen in the kernel, and the resulting PDUs travel over ordinary kernel TCP sockets.
  • The trade-off: no special hardware is needed, but the host CPU does all the protocol work, so siw doesn’t match hardware RDMA’s performance.

Core Abstractions: PDs, MRs and STags

RDMA peers address remote memory with Steering Tags (STags) rather than raw virtual addresses:

  • Protection Domain (PD): A security container that groups Memory Regions (MRs) and Queue Pairs (QPs). An STag created in one PD cannot be accessed by a QP belonging to a different PD.
  • Memory Registration (MR): When an application wants to expose a memory buffer, it calls ibv_reg_mr(). The kernel pins the memory pages, records authorized access permissions (e.g., IB_ACCESS_REMOTE_WRITE, IB_ACCESS_REMOTE_READ), and returns a 32-bit STag (rkey).
  • Zero-Copy Remote Access: Once a remote machine knows the target STag, tagged offset, and buffer length, it can send an RDMA Read or Write request directly targeting that memory buffer.

Why the Kernel Is the Only Check

With ordinary sockets, the receiving application takes part in every transfer: data only reaches its memory when it calls recv(). RDMA’s one-sided operations remove that step. Once Machine B registers a buffer and gives Machine A its STag:

  • RDMA Write: Machine A places data directly into B’s buffer.
  • RDMA Read: Machine A pulls data directly out of B’s buffer.

In both operations, Machine B’s user-space application is never notified, never wakes up, and never calls recv(). Under hardware RDMA, the NIC handles the transfer; under Soft-iWARP, the siw driver handles it entirely in the kernel without consulting the target process.

That makes Soft-iWARP’s permission check (siw_check_mem()) the only thing enforcing what a remote peer may do with registered memory.

When an application registers a staging buffer or mailbox with IB_ACCESS_REMOTE_WRITE but without IB_ACCESS_REMOTE_READ, it lets peers push data in while forbidding them to read anything back out. The iWARP specifications (RFC 5040, and RFC 5042 for its security considerations) expect an RDMA Read against such a region to be rejected.

Root Cause: The Permission Check in Soft-iWARP

Every work queue element (WQE) that siw transmits goes through siw_qp_sq_proc_tx() in siw_qp_tx.c. Most of them are posted by the local application. READ responses are not: siw’s receive path builds them from a remote peer’s READ request. The call tree below shows both sources and the permission check they share:

Local application ibv_post_send(): SEND / WRITE / READ Remote peer: RDMA READ request source STag · source offset · read size (peer-chosen) siw_init_rresp(qp, srx) siw_qp_rx.c · builds READ_RESPONSE from the request siw_qp_sq_proc_tx(qp, wqe) drivers/infiniband/sw/siw/siw_qp_tx.c OP_READ / READ_LOCAL_INV SEND / WRITE / SIW_OP_READ_RESPONSE Skips siw_check_sgl_tx() wqe->bytes = 0 Call Tree Overview 1. Local app and remote peer both feed the SQ 2. siw_mem.c resolves the STag to an MR 3. siw_check_mem() checks perms Bug: peer-chosen buffer, perms = 0 siw_check_sgl_tx(qp->pd, wqe, 0) siw_qp_tx.c · iterates scatter-gather entries with perms = 0 for each non-zero-length SGE siw_check_sge(pd, sge, &wqe->mem[i], ...) siw_mem.c · bounds check & STag -> struct siw_mem lookup siw_check_mem(pd, *mem, addr, perms, len) siw_mem.c · checks (mem->perms & 0) < 0 -> always false
Call tree across siw_qp_rx.c, siw_qp_tx.c and siw_mem.c: a READ response is built from values the remote peer chose, then checked with the same perms = 0 rule as the local application's own sends.

Before transmitting a WQE, siw_qp_sq_proc_tx() makes sure the memory it is about to send is valid, in bounds, and accessible. For every type except local READ requests, it calls siw_check_sgl_tx() with a required-permission mask of 0:

static int siw_qp_sq_proc_tx(struct siw_qp *qp, struct siw_wqe *wqe)
{
...
	if (wqe->wr_status == SIW_WR_QUEUED) {
		if (!(wqe->sqe.flags & SIW_WQE_INLINE)) {
			if (tx_type(wqe) == SIW_OP_READ_RESPONSE)
				wqe->sqe.num_sge = 1;

			if (tx_type(wqe) != SIW_OP_READ &&
			    tx_type(wqe) != SIW_OP_READ_LOCAL_INV) {
				/*
				 * Reference memory to be tx'd w/o checking
				 * access for LOCAL_READ permission, since
				 * not defined in RDMA core.
				 */
				rv = siw_check_sgl_tx(qp->pd, wqe, 0);
				if (rv < 0) {
					if (tx_type(wqe) ==
					    SIW_OP_READ_RESPONSE)
						ecode = siw_rdmap_error(-rv);
					rv = -EINVAL;
					goto tx_error;
				}
				wqe->bytes = rv;
			} else {
				wqe->bytes = 0;
			}
		}
		...
	}

siw_check_sgl_tx() walks the scatter-gather list and, for every entry with a non-zero length, calls siw_check_sge() in siw_mem.c. That function looks up the STag, checks bounds, and hands the permission test to siw_check_mem():

int siw_check_mem(struct ib_pd *pd, struct siw_mem *mem, u64 addr,
		  enum ib_access_flags perms, int len)
{
	...
	if (mem->pd != pd) {
		siw_dbg_pd(pd, "STag 0x%08x: PD mismatch\n", mem->stag);
		return -E_PD_MISMATCH;
	}
	/*
	 * check access permissions
	 */
	if ((mem->perms & perms) < perms) {
		...
		return -E_ACCESS_PERM;
	}
	...
}

With perms = 0, the test becomes (mem->perms & 0) < 0, that is 0 < 0, which is always false. Whatever permissions a memory region was registered with, this check passes.

One Transmit Path, Two Trust Levels

include/rdma/ib_verbs.h defines IB_ACCESS_LOCAL_WRITE, IB_ACCESS_REMOTE_WRITE, IB_ACCESS_REMOTE_READ and IB_ACCESS_REMOTE_ATOMIC, but no IB_ACCESS_LOCAL_READ: a process can always read memory it registered itself. So when siw transmits a SEND or an RDMA WRITE, the buffer was chosen by the local application, and requiring no permission bit is correct. The original comment says exactly that.

But siw_qp_sq_proc_tx() also transmits RDMA READ responses, and those buffers are not chosen locally. When a peer’s READ request arrives, siw_init_rresp() in siw_qp_rx.c queues a response whose source is copied straight from the request:

	uint64_t raddr = be64_to_cpu(srx->hdr.rreq.sink_to),
		 laddr = be64_to_cpu(srx->hdr.rreq.source_to);
	uint32_t length = be32_to_cpu(srx->hdr.rreq.read_size),
		 lkey = be32_to_cpu(srx->hdr.rreq.source_stag),
		 rkey = be32_to_cpu(srx->hdr.rreq.sink_stag),
		 msn = be32_to_cpu(srx->hdr.rreq.ddp_msn);
	...
		resp->opcode = SIW_OP_READ_RESPONSE;

		resp->sge[0].length = length;
		resp->sge[0].laddr = laddr;
		resp->sge[0].lkey = lkey;

The remote peer picks the STag, the offset and the length, and the transmit path then checks them with the local-send rule: no permission required. One code path serves two trust levels, and it applies the assumptions of the trusted one to both.

The asymmetry is visible within siw itself. When a peer’s RDMA WRITE arrives, the receive path checks the target region for the matching remote permission:

	rv = siw_check_mem(qp->pd, mem, srx->ddp_to + srx->fpdu_part_rcvd,
			   IB_ACCESS_REMOTE_WRITE, bytes);

The read direction had no equivalent check. Soft-RoCE (rxe), the other software RDMA driver in the kernel, requires IB_ACCESS_REMOTE_READ for incoming reads in rxe_resp.c.

Why Nobody Caught It for Seven Years

The bug shipped with siw itself in Linux 5.3 (2019). It is a logic bug: nothing crashes, nothing is corrupted, and KASAN has nothing to report. Fuzzers and sanitizers look for memory-safety violations, not a check that passes when it should fail. Triggering it also means acting as a remote RDMA peer, which kernel fuzzing setups don’t easily do. Code nobody spends time on keeps its bugs.

Impact and Preconditions

To read a write-only region, an attacker needs:

  • an RDMA connection that the target application accepted. siw runs over TCP, so ordinary network access is enough to connect if the application is listening;
  • a queue pair in the same protection domain as the target region;
  • a valid STag and an address inside the region. In practice, that means a peer the application intended to let write.

What leaks is the contents of registered memory regions, not arbitrary kernel or process memory: siw_check_sge() still enforces bounds and the protection domain. The realistic threat is that a peer granted write-only access can also read, for example other clients’ data in a shared staging buffer.

siw is used mainly for development, CI and testing setups without RDMA hardware, rather than at scale in production. Soft-RoCE enforces this permission, as shown above.

Peer (allowed to write) Target server (siw0) 1. TCP + RDMA-CM connect; the server accepts the peer Registers write-only MR (no REMOTE_READ) 2. Server shares the STag (rkey) and buffer address 3. Peer sends an RDMA READ request against that STag 4. siw_init_rresp() → siw_qp_sq_proc_tx() perms = 0, so the check passes 5. READ response returns the write-only region's contents
Attack flow: the peer reads back a region it was only allowed to write, because the read response is checked with perms = 0 instead of IB_ACCESS_REMOTE_READ.

Proof of Concept (PoC)

To confirm the bug, I wrote a test harness (test_siw_poc.c) using librdmacm and libibverbs. It runs a server and a client inside a single QEMU VM, both using the Soft-iWARP device siw0 bound to eth0 at 10.0.2.15:7471.

The Scenario

  1. Server setup: The server allocates a buffer holding a secret:

    static const char SECRET[] = "TOP_SECRET:peer-should-NOT-read-this-without-REMOTE_READ";

    It registers the buffer as write-only, deliberately omitting IBV_ACCESS_REMOTE_READ:

    /* SERVER REGISTERS WRITE-ONLY MR (EXPLICITLY OMITS REMOTE_READ) */
    mr = ibv_reg_mr(pd, buf, LEN, IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE);
  2. Client read: The client connects, receives the server’s STag (rkey) and buffer address, and posts an RDMA READ against the buffer:

    sge.addr = (uintptr_t)rbuf;
    sge.length = LEN;
    sge.lkey = rmr->lkey;
    
    wr.opcode = IBV_WR_RDMA_READ;
    wr.wr.rdma.remote_addr = info.addr;
    wr.wr.rdma.rkey = info.rkey;
    wr.sg_list = &sge;
    wr.num_sge = 1;
    
    ibv_post_send(id->qp, &wr, &bad);

Before the Fix

Running the harness inside QEMU on an unpatched kernel:

QEMU console output: siw0 is active on eth0, the server registers a write-only memory region, and the client's RDMA READ returns the secret string
Unpatched kernel under QEMU: the client's RDMA READ against a write-only memory region returns the secret.

The server returned the full contents of the write-only buffer.

After the Fix

With the fix, siw_check_mem() rejects the read response with E_ACCESS_PERM, and siw_qp_sq_proc_tx() takes its error path: instead of sending data, the target terminates the connection with an RDMAP remote-protection error, which is how iWARP reports access violations (RFC 5040). The client’s READ fails rather than returning the secret. I haven’t rerun the harness on a patched kernel, so this follows the code path rather than captured output.

The Remediation

The fix is small: when siw_qp_sq_proc_tx() processes an RDMA READ response (SIW_OP_READ_RESPONSE), it requires IB_ACCESS_REMOTE_READ instead of 0. Following the maintainer’s review, the existing num_sge = 1 adjustment moved into the same branch:

--- a/drivers/infiniband/sw/siw/siw_qp_tx.c
+++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
@@ -804,17 +804,21 @@ static int siw_qp_sq_proc_tx(struct siw_qp *qp, struct siw_wqe *wqe)
 
 	if (wqe->wr_status == SIW_WR_QUEUED) {
 		if (!(wqe->sqe.flags & SIW_WQE_INLINE)) {
-			if (tx_type(wqe) == SIW_OP_READ_RESPONSE)
-				wqe->sqe.num_sge = 1;
-
 			if (tx_type(wqe) != SIW_OP_READ &&
 			    tx_type(wqe) != SIW_OP_READ_LOCAL_INV) {
+				enum ib_access_flags perms = 0;
+
 				/*
-				 * Reference memory to be tx'd w/o checking
-				 * access for LOCAL_READ permission, since
-				 * not defined in RDMA core.
+				 * Local READ permission doesn't exist in RDMA core.
+				 * A READ RESPONSE source is read by the remote peer,
+				 * so it must be checked for REMOTE_READ permission.
 				 */
-				rv = siw_check_sgl_tx(qp->pd, wqe, 0);
+				if (tx_type(wqe) == SIW_OP_READ_RESPONSE) {
+					perms = IB_ACCESS_REMOTE_READ;
+					wqe->sqe.num_sge = 1;
+				}
+
+				rv = siw_check_sgl_tx(qp->pd, wqe, perms);
 				if (rv < 0) {
 					if (tx_type(wqe) ==
 					    SIW_OP_READ_RESPONSE)

What each outbound operation requires, before and after:

Outbound operation Who chooses the buffer Required permission (before) Required permission (after)
SEND local application none none
RDMA WRITE local application none none
RDMA READ request local application not checked not checked
READ RESPONSE remote peer none IB_ACCESS_REMOTE_READ

Disclosure and Timeline

I sent the fix to the siw maintainer and the linux-rdma mailing list; both review threads are public on lore (v1–v2, v3). Bernard Metzler, who wrote siw, called it an “Excellent finding!”, suggested a small cleanup that went into v2, and acked it. Leon Romanovsky applied v3 to rdma.git. It reached mainline as f74eac4fc6c5 and was backported to the 7.3, 6.18, 6.12, 6.6, 6.1, 5.15 and 5.10 stable kernels; the CVE record lists the stable commits.

  • Oct 4, 2026: Found the bug and confirmed the leak in QEMU.
  • Oct 5, 2026: Sent v1 to linux-rdma. Bernard Metzler reviewed it, and I sent v2 with his suggested cleanup.
  • Oct 6, 2026: Acked-by: Bernard Metzler on v2.
  • Oct 11, 2026: Sent v3 with the Acked-by tag.
  • Oct 12, 2026: Applied to rdma.git by Leon Romanovsky.
  • Nov 17, 2026: Merged into mainline and queued for the 7.3, 6.18, 6.12, 6.6, 6.1, 5.15 and 5.10 stable trees.
  • Nov 18–19, 2026: Stable review patches sent for all seven branches.
  • Nov 30, 2026: CVE-2026-139415 published by the kernel CNA.

Takeaways

  1. Shared code paths across trust boundaries are where checks go missing. One function sent both locally chosen and peer-chosen buffers, and its permission logic was written for the first case only.
  2. Logic bugs don’t crash. No sanitizer or fuzzer was going to flag a check that passes. Asking one question of permission code, “who controls this value?”, was enough.
  3. Software implementations of hardware protocols deserve fresh eyes. XBOW showed it with SMC-D; Soft-iWARP is another example.
  4. AI widens the search; human judgment narrows it. The AI covered ground I couldn’t have covered alone, and steering it toward neglected code is what turned that coverage into a finding.

The title is a nod to XBOW's No Time to Pwn: CVE-2026-72018 by Baul Lee. In their words, a bug that falls victim to "no time to pwn" is one that never gets discovered because nobody spends the time on it. I'm not affiliated with XBOW.