lkml.org 
[lkml]   [2014]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] arch/sh/kernel/ptrace_{32,64}.c: drop negativity checks for unsigned long addr
Date
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80381
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
arch/sh/kernel/ptrace_32.c | 4 ++--
arch/sh/kernel/ptrace_64.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index c1a6b89..78effcb 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -379,7 +379,7 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long tmp;

ret = -EIO;
- if ((addr & 3) || addr < 0 ||
+ if ((addr & 3) ||
addr > sizeof(struct user) - 3)
break;

@@ -419,7 +419,7 @@ long arch_ptrace(struct task_struct *child, long request,

case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
ret = -EIO;
- if ((addr & 3) || addr < 0 ||
+ if ((addr & 3) ||
addr > sizeof(struct user) - 3)
break;

diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index 5cea973..138b2b1 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -395,7 +395,7 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long tmp;

ret = -EIO;
- if ((addr & 3) || addr < 0)
+ if (addr & 3)
break;

if (addr < sizeof(struct pt_regs))
@@ -423,7 +423,7 @@ long arch_ptrace(struct task_struct *child, long request,
this could crash the kernel or result in a security
loophole. */
ret = -EIO;
- if ((addr & 3) || addr < 0)
+ if (addr & 3)
break;

if (addr < sizeof(struct pt_regs)) {
--
1.8.5.5


\
 
 \ /
  Last update: 2014-07-17 16:21    [W:0.043 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site