OSDN Git Service
(root)
/
linux-kernel-docs
/
linux-2.4.36.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
02622ae
)
[PATCH] range checking for sleep states sent to /proc/acpi/sleep
author
Willy Tarreau
<w@1wt.eu>
Tue, 20 Jun 2006 22:42:43 +0000
(
00:42
+0200)
committer
Marcelo Tosatti
<marcelo@dmt.cnet>
Wed, 21 Jun 2006 13:40:43 +0000
(10:40 -0300)
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.
drivers/acpi/system.c
patch
|
blob
|
history
diff --git
a/drivers/acpi/system.c
b/drivers/acpi/system.c
index
a1e018c
..
26f7b68
100644
(file)
--- 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);
/*