[patch 05/09] x86_64: Fix ptrace boundary check
From: Chris Wright
Date: Wed Jun 08 2005 - 19:27:15 EST
Don't allow accesses below register frame in ptrace
There was a "off by one quad word" error in there.
Found and fixed by John Blackwood
Signed-off-by: Andi Kleen <ak@xxxxxxx>
Signed-off-by: Chris Wright <chrisw@xxxxxxxx>
arch/x86_64/kernel/ptrace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: release-2.6.11/arch/x86_64/kernel/ptrace.c
===================================================================
--- release-2.6.11.orig/arch/x86_64/kernel/ptrace.c
+++ release-2.6.11/arch/x86_64/kernel/ptrace.c
@@ -252,7 +252,7 @@ asmlinkage long sys_ptrace(long request,
break;
switch (addr) {
- case 0 ... sizeof(struct user_regs_struct):
+ case 0 ... sizeof(struct user_regs_struct) - sizeof(long):
tmp = getreg(child, addr);
break;
case offsetof(struct user, u_debugreg[0]):
@@ -297,7 +297,7 @@ asmlinkage long sys_ptrace(long request,
break;
switch (addr) {
- case 0 ... sizeof(struct user_regs_struct):
+ case 0 ... sizeof(struct user_regs_struct) - sizeof(long):
ret = putreg(child, addr, data);
break;
/* Disallows to set a breakpoint into the vsyscall */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/