Bug 80381

Summary: sh/kernel/ptrace_32.c: 2 * pointless tests ?
Product: Platform Specific/Hardware Reporter: David Binderman (dcb314)
Component: OtherAssignee: platform_other
Status: NEW ---    
Severity: low CC: andrey_utkin
Priority: P1    
Hardware: Other   
OS: Linux   
Kernel Version: 3.16-rc5 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2014-07-16 17:19:14 UTC
1.

[linux-3.16-rc5/arch/sh/kernel/ptrace_32.c:382]: (style) Checking if unsigned variable 'addr' is less than zero.

Source code is

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

but

    unsigned long addr,

Suggest new code

        if ((addr & 3) || 
            addr > sizeof(struct user) - 3)
            break;

2.

[linux-3.16-rc5/arch/sh/kernel/ptrace_32.c:422]: (style) Checking if unsigned variable 'addr' is less than zero.

Duplicate.
Comment 1 David Binderman 2014-07-16 17:20:17 UTC
Same thing at

arch/sh/kernel/ptrace_64.c:398

and

arch/sh/kernel/ptrace_64.c:426
Comment 2 Andrey Utkin 2014-07-17 13:30:45 UTC
Thanks, patch submitted: https://patchwork.kernel.org/patch/4575041/