[PATCH] x86_64: Fix ptrace boundary check

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@suse.de>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Andi Kleen 2005-06-01 12:47:30 +02:00 committed by Chris Wright
parent 51af80e5f4
commit fa74054062
1 changed files with 2 additions and 2 deletions

View File

@ -252,7 +252,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
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, long pid, unsigned long addr, long data
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 */