Patch "cxl/acpi: Fix a use-after-free in cxl_parse_cfmws()" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    cxl/acpi: Fix a use-after-free in cxl_parse_cfmws()

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cxl-acpi-fix-a-use-after-free-in-cxl_parse_cfmws.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit afcc716e06ca69e788292d73b1ada0f8c11567db
Author: Breno Leitao <leitao@xxxxxxxxxx>
Date:   Fri Jul 14 02:31:45 2023 -0700

    cxl/acpi: Fix a use-after-free in cxl_parse_cfmws()
    
    [ Upstream commit 4cf67d3cc9994a59cf77bb9c0ccf9007fe916afe ]
    
    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 <leitao@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230714093146.2253438-1-leitao@xxxxxxxxxx
    Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>
    Reviewed-by: Dave Jiang <dave.jiang@xxxxxxxxx>
    Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Signed-off-by: Vishal Verma <vishal.l.verma@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index 7e1765b09e04a..973d6747078c9 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -296,8 +296,7 @@ static int cxl_parse_cfmws(union acpi_subtable_headers *header, void *arg,
 	else
 		rc = cxl_decoder_autoremove(dev, cxld);
 	if (rc) {
-		dev_err(dev, "Failed to add decode range [%#llx - %#llx]\n",
-			cxld->hpa_range.start, cxld->hpa_range.end);
+		dev_err(dev, "Failed to add decode range: %pr", res);
 		return 0;
 	}
 	dev_dbg(dev, "add: %s node: %d range [%#llx - %#llx]\n",



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux