lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53128125.1080809@linux.intel.com>
Date:	Sun, 02 Mar 2014 08:53:57 +0800
From:	"Li, Aubrey" <aubrey.li@...ux.intel.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
CC:	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
	Len.Brown@...el.com, "alan@...ux.intel.com" <alan@...ux.intel.com>,
	"Raj, Ashok" <ashok.raj@...el.com>
Subject: Re: [PATCH] ACPI/Sleep: pm_power_off need more sanity check to be
 installed

On 2014/3/2 8:39, Rafael J. Wysocki wrote:
> On Saturday, March 01, 2014 06:24:23 AM Li, Aubrey wrote:
>>>> Do we still want to set this if the check below fails?  If so, then why?
>>>
>>> We know \_S5_ is valid. The fault is sleep registers, not S5 ACPI object
>>
>> Hi Rafael, do you still have any concern?
> 
> Well, I simply don't think we should say that it is "supported" if we aren't
> going to do anything with it.
> 

Make sense to me. Patch refined as below:

Sleep control and status registers need santity check as well before
ACPI install acpi_power_off to pm_power_off hook. The checking code in
acpi_enter_sleep_state() is too late, we should not allow a not-working
pm_power_off function hooked.

Signed-off-by: Aubrey Li <aubrey.li@...el.com>

---
 drivers/acpi/sleep.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index b718806..0abfbb1 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -807,7 +807,12 @@ int __init acpi_sleep_init(void)
 	acpi_sleep_hibernate_setup();

 	status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
-	if (ACPI_SUCCESS(status)) {
+	/*
+	 * Check both ACPI S5 object and ACPI sleep registers to
+	 * install pm_power_off_prepare/pm_power_off hook
+	 */
+	if (ACPI_SUCCESS(status) && acpi_gbl_FADT.sleep_control.address &&
+		acpi_gbl_FADT.sleep_status.address) {
 		sleep_states[ACPI_STATE_S5] = 1;
 		pm_power_off_prepare = acpi_power_off_prepare;
 		pm_power_off = acpi_power_off;
-- 1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ