lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 May 2016 12:44:13 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	xiyou.wangcong@...il.com
Cc:	linuxdev.baldrick@...il.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, dcb314@...mail.com
Subject: Re: linux-4.6/net/kcm/kcmsock.c:1508: bad if test ?

From: Cong Wang <xiyou.wangcong@...il.com>
Date: Tue, 17 May 2016 09:04:21 -0700

> On Mon, May 16, 2016 at 11:40 AM, David Binderman
> <linuxdev.baldrick@...il.com> wrote:
>> Hello there,
>>
>> linux-4.6/net/kcm/kcmsock.c:1508]: (style) Checking if unsigned
>> variable 'copied' is less than zero.
>>
>> Source code is
>>
>>     if (copied < 0) {
>>
>> but
>>
>>    size_t copied;
>>
>> Suggest code rework.
> 
> Thanks for the report! I think the following patch is enough:
> 
> diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
> index 40662d73..8bfc390 100644
> --- a/net/kcm/kcmsock.c
> +++ b/net/kcm/kcmsock.c
> @@ -1483,7 +1483,7 @@ static ssize_t kcm_splice_read(struct socket
> *sock, loff_t *ppos,
>         long timeo;
>         struct kcm_rx_msg *rxm;
>         int err = 0;
> -       size_t copied;
> +       int copied;

Or 'ssize_t' since that is the return type of this function.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ