cxl/mbox: Clamp mailbox output allocation to the payload size
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 583fa5e71caeb79e04e477e9837e2f7fa53b71e4 · < 8a13db9f899d149c3aab24abcb668121cfda5a4f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
cxl/mbox: Clamp mailbox output allocation to the payload size
CXL_MEM_SEND_COMMAND bounds the user's in.size to the mailbox payload size but leaves out.size unbounded, then cxl_mbox_cmd_ctor() calls kvzalloc(out.size). A large out.size drives a huge allocation, above INT_MAX it WARNs and taints, and with panic_on_warn=1 it panics.
The transport __cxl_pci_mbox_send_cmd() already clamps the response copy to min(out.size, payload_size, device len), so the output buffer is never written beyond payload_size. Clamp the allocation to payload_size too, matching the RAW path.
From the CVE record · Linux
The Linux kernel's CXL mailbox accepts an unbounded output size for CXL_MEM_SEND_COMMAND and uses it to allocate a buffer. Someone able to submit that command can trigger a very large allocation; sizes above INT_MAX cause a warning and, when panic_on_warn=1, a kernel panic.
Engineers running Linux kernels with the CXL mailbox code should check their systems; affected versions are not specified.