Skip to contentSkip to conversation

x86 - Fencepost errors in compat ptrace

PATCH New Jeff Dike 1 participant 1 message Jan 10, 2008

Subsystems (2)
lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/1 x86 - Fencepost errors in compat ptrace

The compat PTRACE_SETREGS and PTRACE_GETREGS are verifying_area one word too few.

---
 arch/x86/ia32/ptrace32.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/ia32/ptrace32.c +2 -2
index 4a233ad..e5d4eff 100644
@@ -312,7 +312,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 
 	case PTRACE_GETREGS: { /* Get all gp regs from the child. */
 		int i;
-	  	if (!access_ok(VERIFY_WRITE, datap, 16*4)) {
+	  	if (!access_ok(VERIFY_WRITE, datap, 17*4)) {
 			ret = -EIO;
 			break;
 		}
@@ -328,7 +328,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 	case PTRACE_SETREGS: { /* Set all gp regs in the child. */
 		unsigned long tmp;
 		int i;
-	  	if (!access_ok(VERIFY_READ, datap, 16*4)) {
+	  	if (!access_ok(VERIFY_READ, datap, 17*4)) {
 			ret = -EIO;
 			break;
 		}