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:   Thu, 06 Jun 2019 11:35:47 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     dsahern@...il.com
Cc:     info@...ux.net, linux-kernel@...r.kernel.org, kuznet@....inr.ac.ru,
        yoshfuji@...ux-ipv6.org, netdev@...r.kernel.org
Subject: Re: [PATCH] net: ipv4: fib_semantics: fix uninitialized variable

From: David Ahern <dsahern@...il.com>
Date: Thu, 6 Jun 2019 09:47:34 -0600

> On 6/6/19 8:43 AM, Enrico Weigelt, metux IT consult wrote:
>> From: Enrico Weigelt <info@...ux.net>
>> 
>> fix an uninitialized variable:
>> 
>>   CC      net/ipv4/fib_semantics.o
>> net/ipv4/fib_semantics.c: In function 'fib_check_nh_v4_gw':
>> net/ipv4/fib_semantics.c:1027:12: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>    if (!tbl || err) {
>>             ^~
>> 
>> Signed-off-by: Enrico Weigelt <info@...ux.net>
>> ---
>>  net/ipv4/fib_semantics.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
>> index b804106..bfa49a8 100644
>> --- a/net/ipv4/fib_semantics.c
>> +++ b/net/ipv4/fib_semantics.c
>> @@ -964,7 +964,7 @@ static int fib_check_nh_v4_gw(struct net *net, struct fib_nh *nh, u32 table,
>>  {
>>  	struct net_device *dev;
>>  	struct fib_result res;
>> -	int err;
>> +	int err = 0;
>>  
>>  	if (nh->fib_nh_flags & RTNH_F_ONLINK) {
>>  		unsigned int addr_type;
>> 
> 
> what compiler version?
> 
> if tbl is set, then err is set.

It's unfortunate that it can't walk through that simple logic and set
of dependencies but we'll have to quiet this warning whether we like it
or not.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ