RDMA/umad: Reject negative data_len in ib_umad_write
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2be8e3ee8efd6f99ce454115c29d09750915021a · < 205955f29c26330b1dc7fdeadd5bb97c38e26f56| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/umad: Reject negative data_len in ib_umad_write
ib_umad_write computes data_len from user-controlled count and the MAD header sizes. With a mismatched user MAD header size and RMPP header length, data_len can become negative and reach ib_create_send_mad(). This can make the padding calculation exceed the segment size and trigger an out-of-bounds memset in alloc_send_rmpp_list().
Add an explicit check to reject negative data_len before creating the send buffer.
KASAN splat: [ 211.363464] BUG: KASAN: slab-out-of-bounds in ib_create_send_mad+0xa01/0x11b0 [ 211.364077] Write of size 220 at addr ffff88800c3fa1f8 by task spray_thread/102 [ 211.365867] ib_create_send_mad+0xa01/0x11b0 [ 211.365887] ib_umad_write+0x853/0x1c80
From the CVE record · Linux
The Linux kernel's ib_umad_write can calculate a negative data length from user-controlled input when the user MAD header size and RMPP header length do not match. A local caller able to write to the RDMA umad interface can trigger an out-of-bounds memset; the input does not specify whether authentication or other user interaction is required.
Teams running Linux kernels with the RDMA/umad component should check whether their kernel includes the fix; affected versions are not specified.