HIGH Introduced in 4.6
rds FRMR UAF
CVE-2026-98524
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: rds: ib: Clear the sg list when mapping an MR fails rds_ib_map_frmr() stores the caller's scatterlist in the MR before DMA mapping and registration can fail. On failure, __rds_rdma_map() unpins the pages and frees the scatterlist, but rds_ib_free_frmr() can still return the MR to the pool with the stale pointer set. This leaves the pool with a dangling scatterlist and can lead to local privilege escalation. KASAN detects the resulting use-after-free when the MR is later torn down: BUG: KASAN: slab-use-after-free in __rds_ib_teardown_mr Read of size 8 Call Trace: __rds_ib_teardown_mr rds_ib_unreg_frmr rds_ib_flush_mr_pool rds_ib_flush_mrs rds_free_mr rds_setsockopt Store the scatterlist in the MR only after DMA mapping succeeds. If DMA mapping fails, return directly while the MR fields remain clear; the caller keeps ownership of the scatterlist and its pinned pages. If a later registration step fails, unmap the scatterlist and clear the MR fields before returning.
02KernelScan AI Analysis
Risk summary
A local unprivileged user can trigger a use-after-free in the RDS InfiniBand fast-registration memory region (FRMR) code by causing a DMA mapping failure during memory registration. This leads to a dangling scatterlist pointer being left in a pooled memory region object, which is later accessed during teardown, enabling potential kernel privilege escalation.
Vulnerability analysis
The bug occurs when the RDS IB FRMR driver stores a caller-provided scatterlist in a memory region object before attempting DMA mapping. If the DMA mapping fails, the error path frees the scatterlist but leaves the stale pointer in the pooled object. When that object is later reused and torn down, the kernel accesses the freed scatterlist, creating a use-after-free condition. The fix reorders the code so the scatterlist pointer is only stored after DMA mapping succeeds, and explicitly clears the pointer on any later registration failure. An attacker needs only local access to create an RDS socket and invoke the relevant setsockopt; no special privileges or hardware beyond an RDMA-capable device with FRMR support are required.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 4.6 | 5.10.271 | 1be3211e6ac7 |
| 5.15 | 4.6 | 5.15.222 | c42d316163f8 |
| 6.1 | 4.6 | 6.1.189 | 8dca3c813445 |
| 6.12 | 4.6 | 6.12.112 | 4468df5bcdef |
| 6.18 | 4.6 | 6.18.55 | e2ee06162600 |
| 6.6 | 4.6 | 6.6.158 | 49ba5ed01299 |
| 7.2 | 4.6 | 7.2.9 | b36d32f30c3f |
| mainline | 4.6 | 7.3 | 58eb1b3325ed |
| cip/4.19 | 4.6 | 4.19.325-cip137 | 3bb2e69e5e4b |
| cip/4.19-rt | 4.6 | 4.19.325-cip137-rt51 | 3bb2e69e5e4b |
| cip/5.10 | 4.6 | 5.10.271-cip78 | 1be3211e6ac7 |
| cip/5.10-rt | 4.6 | 5.10.272-cip79-rt35 | 1be3211e6ac7 |
| cip/6.1 | 4.6 | 6.1.189-cip61 | 8dca3c813445 |
| cip/6.1-rt | 4.6 | 6.1.189-cip61-rt32 | 8dca3c813445 |
| cip/6.12 | 4.6 | 6.12.112-cip33 | 4468df5bcdef |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.112-cip33 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Fixed in 5.10.272-cip79-rt35 |
| cip/4.19 | Fixed in 4.19.325-cip137 |
| cip/4.19-rt | Fixed in 4.19.325-cip137-rt51 |