Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1734484
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: linux-4.14-rc1/kernel/sysctl.c:2188: possible cut'n'paste error ? |
| Date | 2017-09-18 23:10 +0200 |
| Message-ID | <urbsK-3nw-15@gated-at.bofh.it> (permalink) |
| References | <urbsK-3nw-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Sep 18, 2017 at 1:53 PM, David Binderman <dcb314@hotmail.com> wrote:
> Hello there,
>
> linux-4.14-rc1/kernel/sysctl.c:2188] -> [linux-4.14-rc1/kernel/sysctl.c:2190]: (warning) Identical condition '*lvalp>UINT_MAX', second condition is always false
>
> Source code is
>
> if (*lvalp > UINT_MAX)
> return -EINVAL;
> if (*lvalp > UINT_MAX)
> return -EINVAL;
>
> Suggest remove second if test.
commit 4f2fec00afa6 ("sysctl: simplify unsigned int support") removed
"negp", but missed the duplication:
-static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp,
- int *valp,
- int write, void *data)
+static int do_proc_douintvec_conv(unsigned long *lvalp,
+ unsigned int *valp,
+ int write, void *data)
{
if (write) {
- if (*negp)
+ if (*lvalp > UINT_MAX)
return -EINVAL;
if (*lvalp > UINT_MAX)
return -EINVAL;
David, do you want to send a patch?
-Kees
--
Kees Cook
Pixel Security
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: linux-4.14-rc1/kernel/sysctl.c:2188: possible cut'n'paste error ? Kees Cook <keescook@chromium.org> - 2017-09-18 23:10 +0200
csiph-web