+ off-by-1-in-kernel-power-mainc.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     off-by-1 in kernel/power/main.c

has been added to the -mm tree.  Its filename is

     off-by-1-in-kernel-power-mainc.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this


From: dean gaudet <dean@xxxxxxxxxx>

There's an off-by-1 in kernel/power/main.c:state_store() ...  if your
kernel just happens to have some non-zero data at pm_states[PM_SUSPEND_MAX]
(i.e.  one past the end of the array) then it'll let you write anything you
want to /sys/power/state and in response the box will enter S5.

Signed-off-by: dean gaudet <dean@xxxxxxxxxx>
Acked-by: Pavel Machek <pavel@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 kernel/power/main.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN kernel/power/main.c~off-by-1-in-kernel-power-mainc kernel/power/main.c
--- devel/kernel/power/main.c~off-by-1-in-kernel-power-mainc	2006-04-22 16:20:29.000000000 -0700
+++ devel-akpm/kernel/power/main.c	2006-04-22 16:20:29.000000000 -0700
@@ -272,7 +272,7 @@ static ssize_t state_store(struct subsys
 		if (*s && !strncmp(buf, *s, len))
 			break;
 	}
-	if (*s)
+	if (state < PM_SUSPEND_MAX && *s)
 		error = enter_state(state);
 	else
 		error = -EINVAL;
_

Patches currently in -mm which might be from dean@xxxxxxxxxx are

off-by-1-in-kernel-power-mainc.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux