Patch "ACPI: EC: Abort address space access upon error" has been added to the 6.6-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: EC: Abort address space access upon error

to the 6.6-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-ec-abort-address-space-access-upon-error.patch
and it can be found in the queue-6.6 subdirectory.

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



commit cd6302526fb9fd86dcdf1c334bd5f4356fa49ce5
Author: Armin Wolf <W_Armin@xxxxxx>
Date:   Wed May 22 23:36:48 2024 +0200

    ACPI: EC: Abort address space access upon error
    
    [ Upstream commit f6f172dc6a6d7775b2df6adfd1350700e9a847ec ]
    
    When a multi-byte address space access is requested, acpi_ec_read()/
    acpi_ec_write() is being called multiple times.
    
    Abort such operations if a single call to acpi_ec_read() /
    acpi_ec_write() fails, as the data read from / written to the EC
    might be incomplete.
    
    Signed-off-by: Armin Wolf <W_Armin@xxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index bdeae6ca9f059..3a2103da6a21c 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1333,10 +1333,13 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
 	if (ec->busy_polling || bits > 8)
 		acpi_ec_burst_enable(ec);
 
-	for (i = 0; i < bytes; ++i, ++address, ++value)
+	for (i = 0; i < bytes; ++i, ++address, ++value) {
 		result = (function == ACPI_READ) ?
 			acpi_ec_read(ec, address, value) :
 			acpi_ec_write(ec, address, *value);
+		if (result < 0)
+			break;
+	}
 
 	if (ec->busy_polling || bits > 8)
 		acpi_ec_burst_disable(ec);




[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