Bug 80381 - sh/kernel/ptrace_32.c: 2 * pointless tests ?
Summary: sh/kernel/ptrace_32.c: 2 * pointless tests ?
Status: NEW
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: Other (show other bugs)
Hardware: Other Linux
: P1 low
Assignee: platform_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-16 17:19 UTC by David Binderman
Modified: 2014-07-17 13:30 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.16-rc5
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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/

Note You need to log in before you can comment on or make changes to this bug.