summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorRichard Cheng <icheng@nvidia.com>2026-06-24 22:41:47 +0800
committerDave Jiang <dave.jiang@intel.com>2026-06-29 08:40:06 -0700
commit8a13db9f899d149c3aab24abcb668121cfda5a4f (patch)
tree5c1dfca2ea330b4e40810dc57be20b876bc10847 /tools/lib/python
parentdc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff)
downloadlinux-8a13db9f899d149c3aab24abcb668121cfda5a4f.tar.gz
linux-8a13db9f899d149c3aab24abcb668121cfda5a4f.zip
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. Fixes: 583fa5e71cae ("cxl/mem: Add basic IOCTL interface") Reviewed-by: Kai-Heng Feng <kaihengf@nvidia.com> Reviewed-by: Koba Ko <kobak@nvidia.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Signed-off-by: Richard Cheng <icheng@nvidia.com> Link: https://patch.msgid.link/20260624144147.53997-1-icheng@nvidia.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions