diff options
author | Lukas Wunner | 2023-03-11 15:40:04 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-04-13 16:55:25 +0200 |
commit | 5f625160b67ff5674947e4783d867612093baed5 (patch) | |
tree | 0251d199a19775304921d916fee4bed8cc130573 /drivers/pci | |
parent | 0d8dc8993a8d79681a85508c0da18a2d01651be8 (diff) |
cxl/pci: Handle excessive CDAT length
commit 4fe2c13d59d849be3b45371e3913ec5dc77fc0fb upstream.
If the length in the CDAT header is larger than the concatenation of the
header and all table entries, then the CDAT exposed to user space
contains trailing null bytes.
Not every consumer may be able to handle that. Per Postel's robustness
principle, "be liberal in what you accept" and silently reduce the
cached length to avoid exposing those null bytes.
Fixes: c97006046c79 ("cxl/port: Read CDAT table")
Tested-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: stable@vger.kernel.org # v6.0+
Link: https://lore.kernel.org/r/6d98b3c7da5343172bd3ccabfabbc1f31c079d74.1678543498.git.lukas@wunner.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci')
0 files changed, 0 insertions, 0 deletions