This is a note to let you know that I've just added the patch titled
sparc: fix ldom_reboot buffer overflow harder
to the 3.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
sparc-fix-ldom_reboot-buffer-overflow-harder.patch
and it can be found in the queue-3.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From c0df7cd18f0c94fabb00a2e89d561934ae7b7a74 Mon Sep 17 00:00:00 2001
From: Kees Cook <[email protected]>
Date: Tue, 1 Oct 2013 22:13:34 -0700
Subject: sparc: fix ldom_reboot buffer overflow harder
From: Kees Cook <[email protected]>
[ Upstream commit 20928bd3f08afb036c096d9559d581926b895918 ]
The length argument to strlcpy was still wrong. It could overflow the end of
full_boot_str by 5 bytes. Instead of strcat and strlcpy, just use snprint.
Reported-by: Brad Spengler <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/sparc/kernel/ds.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/arch/sparc/kernel/ds.c
+++ b/arch/sparc/kernel/ds.c
@@ -842,9 +842,8 @@ void ldom_reboot(const char *boot_comman
if (boot_command && strlen(boot_command)) {
unsigned long len;
- strcpy(full_boot_str, "boot ");
- strlcpy(full_boot_str + strlen("boot "), boot_command,
- sizeof(full_boot_str));
+ snprintf(full_boot_str, sizeof(full_boot_str), "boot %s",
+ boot_command);
len = strlen(full_boot_str);
if (reboot_data_supported) {
Patches currently in stable-queue which might be from [email protected] are
queue-3.10/sparc-fix-ldom_reboot-buffer-overflow-harder.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html