mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH-2.4] range checking for sleep states sent to /proc/acpi/sleep
@ 2006-06-20 22:42 Willy Tarreau
  0 siblings, 0 replies; only message in thread
From: Willy Tarreau @ 2006-06-20 22:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: marcelo, len.brown

Hi,

A range checking is missing in acpi_system_write_sleep() in kernel
2.4, and writing a large integer value to /proc/acpi/sleep will cause
an oops. I could reproduce one this way :

   # echo 0x800000 >/proc/acpi/sleep

Fix extracted from the PaX patch.

Cheers,
Willy

---

 drivers/acpi/system.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

3cae76269fd00aa352255d872c8f461472ef8b56
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index a1e018c..26f7b68 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -748,7 +748,7 @@ acpi_system_write_sleep (
 	
 	state = simple_strtoul(state_string, NULL, 0);
 	
-	if (!system->states[state])
+	if (state >= ACPI_S_STATE_COUNT || !system->states[state])
 		return_VALUE(-ENODEV);
 
 	/*
-- 
1.3.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-20 22:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-20 22:42 [PATCH-2.4] range checking for sleep states sent to /proc/acpi/sleep Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®