Skip to content

Commit

Permalink
[PATCH] x86_64: Don't allow accesses below register frame in ptrace
Browse files Browse the repository at this point in the history
There was a "off by one quad word" error in there.  I don't think it is
exploitable because it will only store into a unused area, but better to plug
it.

Found and fixed by John Blackwood

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed May 20, 2005
1 parent b41e293 commit c4d1fcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86_64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,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]):
Expand Down Expand Up @@ -425,7 +425,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 */
Expand Down

0 comments on commit c4d1fcf

Please sign in to comment.