diff options
| author | Terry Bowman <terry.bowman@amd.com> | 2026-08-03 17:17:57 -0500 |
|---|---|---|
| committer | Dave Jiang <dave.jiang@intel.com> | 2026-08-05 13:46:43 -0700 |
| commit | 29458e62d0829cbc99435f3e44fd560f9bbf1da7 (patch) | |
| tree | e2ca25c8a01b4f34f44e04ad797baf569a031dc5 /tools/lib/python | |
| parent | 1590cf0329716306e948a8fc29f1d3ee87d3989f (diff) | |
| download | linux-29458e62d0829cbc99435f3e44fd560f9bbf1da7.tar.gz linux-29458e62d0829cbc99435f3e44fd560f9bbf1da7.zip | |
cxl/ras: Fix cxl_rch_get_aer_info() out-of-bounds AER register read
cxl_rch_get_aer_info() copies the RCH Downstream Port AER capability from
the RCRB MMIO block using a readl() loop bounded by sizeof(struct
aer_capability_regs). This struct is a software layout and its embedded
struct pcie_tlp_log is larger than the on-wire AER capability. As a
result the loop reads past the mapped AER register block.
The over-read also populates the software-only tail fields including
header_log.header_len. An out-of-range header_len passed to
pcie_print_tlp_log() can then loop past the header log buffer and cause
a second out-of-bounds read.
The read was correct when introduced, but struct pcie_tlp_log has since
grown (Header Log and TLP Prefix Log sizes, header_len and flit fields),
so sizeof(struct aer_capability_regs) no longer matches the physical AER
capability.
Bound the read to the physical AER registers, header through the 16 byte
Header Log. Zero the destination first so the software-only fields are
deterministic.
Fixes: 6ac07883dbb5 ("cxl/pci: Add RCH downstream port error logging")
Reported-by: Sashiko <sashiko@linuxfoundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/20260803221810.3685703-2-terry.bowman@amd.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
