Patch "ACPI: video: check for error while searching for backlight device parent" has been added to the 5.15-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

    ACPI: video: check for error while searching for backlight device parent

to the 5.15-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:
     acpi-video-check-for-error-while-searching-for-backl.patch
and it can be found in the queue-5.15 subdirectory.

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



commit fe787123f118a307e1f708bc81988e4faeef4847
Author: Nikita Kiryushin <kiryushin@xxxxxxxx>
Date:   Thu Nov 9 16:49:25 2023 +0300

    ACPI: video: check for error while searching for backlight device parent
    
    [ Upstream commit ccd45faf4973746c4f30ea41eec864e5cf191099 ]
    
    If acpi_get_parent() called in acpi_video_dev_register_backlight()
    fails, for example, because acpi_ut_acquire_mutex() fails inside
    acpi_get_parent), this can lead to incorrect (uninitialized)
    acpi_parent handle being passed to acpi_get_pci_dev() for detecting
    the parent pci device.
    
    Check acpi_get_parent() result and set parent device only in case of success.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 9661e92c10a9 ("acpi: tie ACPI backlight devices to PCI devices if possible")
    Signed-off-by: Nikita Kiryushin <kiryushin@xxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 2b18b51f6351..61bcdc75bee7 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1793,12 +1793,12 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
 		return;
 	count++;
 
-	acpi_get_parent(device->dev->handle, &acpi_parent);
-
-	pdev = acpi_get_pci_dev(acpi_parent);
-	if (pdev) {
-		parent = &pdev->dev;
-		pci_dev_put(pdev);
+	if (ACPI_SUCCESS(acpi_get_parent(device->dev->handle, &acpi_parent))) {
+		pdev = acpi_get_pci_dev(acpi_parent);
+		if (pdev) {
+			parent = &pdev->dev;
+			pci_dev_put(pdev);
+		}
 	}
 
 	memset(&props, 0, sizeof(struct backlight_properties));




[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