Skip to contentSkip to conversation

kexec buffer overflow on ppc platform

PATCH Applied Stefan Assmann 2 participants 2 messages Jan 31, 2008 – Feb 19, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

this patch fixes a buffer overflow on ppc.

Stefan

Signature · 3 lines
Stefan Assmann          | SUSE LINUX Products GmbH
Software Engineer       | Maxfeldstr. 5, D-90409 Nuernberg
Mail : [email protected] | GF: Markus Rex, HRB 16746 (AG Nuernberg)

This patch fixes buffer overflows when buf is allocated MAXBYTES-1 and fread(buf, 1, MAXBYTES, file) is invoked.

---
 kexec/arch/ppc64/crashdump-ppc64.c |    2 +-
 kexec/arch/ppc64/kexec-ppc64.c     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
kexec/arch/ppc64/kexec-ppc64.c +2 -2
Index: b/kexec/arch/ppc64/kexec-ppc64.c
===================================================================
@@ -160,7 +160,7 @@ static int get_base_ranges(void)
 	int local_memory_ranges = 0;
 	char device_tree[256] = "/proc/device-tree/";
 	char fname[256];
-	char buf[MAXBYTES-1];
+	char buf[MAXBYTES];
 	DIR *dir, *dmem;
 	FILE *file;
 	struct dirent *dentry, *mentry;
@@ -258,7 +258,7 @@ static int get_devtree_details(unsigned
 	unsigned long long htab_base, htab_size;
 	unsigned long long kernel_end;
 	unsigned long long initrd_start, initrd_end;
-	char buf[MAXBYTES-1];
+	char buf[MAXBYTES];
 	char device_tree[256] = "/proc/device-tree/";
 	char fname[256];
 	DIR *dir, *cdir;
kexec/arch/ppc64/crashdump-ppc64.c +1 -1
Index: b/kexec/arch/ppc64/crashdump-ppc64.c
===================================================================
@@ -101,7 +101,7 @@ static int get_crash_memory_ranges(struc
 	int memory_ranges = 0;
 	char device_tree[256] = "/proc/device-tree/";
 	char fname[256];
-	char buf[MAXBYTES-1];
+	char buf[MAXBYTES];
 	DIR *dir, *dmem;
 	FILE *file;
 	struct dirent *dentry, *mentry;

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Applied
#1 lore raw
Quoted 3 lines · Stefan Assmann

Hi,

this patch fixes a buffer overflow on ppc.

Thanks, applied.

Signature · 7 lines
Horms


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec