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>] [day] [month] [year] [list]
Message-Id: <200706030011.43733.rjw@sisk.pl>
Date:	Sun, 3 Jun 2007 00:11:42 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
	Tian Kevin <kevin.tian@...el.com>,
	Zhang Rui <rui.zhang@...el.com>, Pavel Machek <pavel@....cz>,
	LKML <linux-kernel@...r.kernel.org>, Andi Kleen <ak@...e.de>
Subject: [PATCH] ACPI: preserve the ebx value in acpi_copy_wakeup_routine

From: Tian Kevin <kevin.tian@...el.com>

Register %ebx serves as the "global offset table base register"
for position-independent code. For absolute code, %ebx serves
as a local register and has no specified role in the function
calling sequence. In either case, a function must preserve the
register value for the caller.

acpi_copy_wakeup_routine overrides %ebx without saving it,
this may corrupt the called data.

Kevin found that most time the value of Sx is saved in %esi,
however sometimes compiler also uses %ebx. When this happens,
suspends fails since sleep value in ebx is changed by
acpi_copy_wakeup_routine.

The same funtion in X86_64 doesn't have this problem.

Signed-off-by: Zhang Rui <rui.zhang@...el.com>
Looks-okay-to: Pavel Machek <pavel@....cz>
Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
---
 arch/i386/kernel/acpi/wakeup.S |    2 ++
 1 files changed, 2 insertions(+)

Index: linux-2.6.22-rc3/arch/i386/kernel/acpi/wakeup.S
===================================================================
--- linux-2.6.22-rc3.orig/arch/i386/kernel/acpi/wakeup.S	2007-05-31 17:23:56.000000000 +0800
+++ linux-2.6.22-rc3/arch/i386/kernel/acpi/wakeup.S	2007-05-31 17:24:08.000000000 +0800
@@ -230,6 +230,7 @@ bogus_magic:
 #
 ENTRY(acpi_copy_wakeup_routine)
 
+	pushl	%ebx
 	sgdt	saved_gdt
 	sidt	saved_idt
 	sldt	saved_ldt
@@ -263,6 +264,7 @@ ENTRY(acpi_copy_wakeup_routine)
 	movl	%edx, video_flags - wakeup_start (%eax)
 	movl	$0x12345678, real_magic - wakeup_start (%eax)
 	movl	$0x12345678, saved_magic
+	popl	%ebx
 	ret
 
 save_registers:
-
-
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