linux/drivers/cxl/core
Lukas Wunner 34bafc747c cxl/pci: Handle truncated CDAT header
cxl_cdat_get_length() only checks whether the DOE response size is
sufficient for the Table Access response header (1 dword), but not the
succeeding CDAT header (1 dword length plus other fields).

It thus returns whatever uninitialized memory happens to be on the stack
if a truncated DOE response with only 1 dword was received.  Fix it.

Fixes: c97006046c ("cxl/port: Read CDAT table")
Reported-by: Ming Li <ming4.li@intel.com>
Tested-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Ming Li <ming4.li@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: stable@vger.kernel.org # v6.0+
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://lore.kernel.org/r/000e69cd163461c8b1bc2cf4155b6e25402c29c7.1678543498.git.lukas@wunner.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2023-04-03 16:16:19 -07:00
..
core.h cxl/dax: Create dax devices for CXL RAM regions 2023-02-10 17:33:45 -08:00
hdm.c Merge branch 'for-6.3/cxl-rr-emu' into cxl/next 2023-02-14 16:06:10 -08:00
Makefile cxl/pci: Move tracepoint definitions to drivers/cxl/core/ 2023-01-04 17:11:11 -08:00
mbox.c Merge branch 'for-6.3/cxl-events' into cxl/next 2023-02-16 15:27:12 -08:00
memdev.c cxl for v6.3 2023-02-25 09:19:23 -08:00
pci.c cxl/pci: Handle truncated CDAT header 2023-04-03 16:16:19 -07:00
pmem.c cxl/pmem: Fix nvdimm unregistration when cxl_pmem driver is absent 2023-01-25 15:35:26 -08:00
port.c cxl for v6.3 2023-02-25 09:19:23 -08:00
region.c Merge branch 'for-6.3/cxl-ram-region' into cxl/next 2023-02-14 14:58:26 -08:00
regs.c cxl/regs: Fix sparse warning 2022-12-05 12:33:20 -08:00
suspend.c PM: CXL: Disable suspend 2022-04-22 16:09:42 -07:00
trace.c cxl/pci: Move tracepoint definitions to drivers/cxl/core/ 2023-01-04 17:11:11 -08:00
trace.h cxl/trace: Add serial number to trace points 2023-02-16 14:29:11 -08:00