diff options
author | Breno Leitao <[email protected]> | 2023-07-14 02:31:45 -0700 |
---|---|---|
committer | Vishal Verma <[email protected]> | 2023-07-18 11:55:02 -0600 |
commit | 4cf67d3cc9994a59cf77bb9c0ccf9007fe916afe (patch) | |
tree | f4e04b7a382233188e9084993f2ced0cbc3a1e9d /drivers/fpga/fpga-mgr.c | |
parent | 004ff1b049dda0ec484328a78fc550a9cfc0942b (diff) |
cxl/acpi: Fix a use-after-free in cxl_parse_cfmws()
KASAN and KFENCE detected an user-after-free in the CXL driver. This
happens in the cxl_decoder_add() fail path. KASAN prints the following
error:
BUG: KASAN: slab-use-after-free in cxl_parse_cfmws (drivers/cxl/acpi.c:299)
This happens in cxl_parse_cfmws(), where put_device() is called,
releasing cxld, which is accessed later.
Use the local variables in the dev_err() instead of pointing to the
released memory. Since the dev_err() is printing a resource, change the open
coded print format to use the %pr format specifier.
Fixes: e50fe01e1f2a ("cxl/core: Drop ->platform_res attribute for root decoders")
Signed-off-by: Breno Leitao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Alison Schofield <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Signed-off-by: Vishal Verma <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
0 files changed, 0 insertions, 0 deletions