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:   Mon, 24 Feb 2020 14:42:43 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     sfr@...b.auug.org.au
Cc:     netdev@...r.kernel.org, linux-next@...r.kernel.org,
        linux-kernel@...r.kernel.org, martin.varghese@...ia.com,
        willemb@...gle.com
Subject: Re: linux-next: build warning after merge of the net-next tree

From: Stephen Rothwell <sfr@...b.auug.org.au>
Date: Tue, 25 Feb 2020 09:27:36 +1100

> After merging the net-next tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
> 
> drivers/net/bareudp.c: In function 'bareudp_xmit_skb':
> drivers/net/bareudp.c:346:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   346 |  return err;
>       |         ^~~
> drivers/net/bareudp.c: In function 'bareudp6_xmit_skb':
> drivers/net/bareudp.c:407:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   407 |  return err;
>       |         ^~~
> 
> Introduced by commit
> 
>   571912c69f0e ("net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc.")

Sorry, my compiler didn't show this.

I've committed the following into net-next, hopefully it does the trick:

====================
[PATCH] bareudp: Fix uninitialized variable warnings.

drivers/net/bareudp.c: In function 'bareudp_xmit_skb':
drivers/net/bareudp.c:346:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
  346 |  return err;
      |         ^~~
drivers/net/bareudp.c: In function 'bareudp6_xmit_skb':
drivers/net/bareudp.c:407:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
  407 |  return err;

Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: David S. Miller <davem@...emloft.net>
---
 drivers/net/bareudp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index 77e72477499d..15337e9d4fad 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -320,6 +320,7 @@ static int bareudp_xmit_skb(struct sk_buff *skb, struct net_device *dev,
 	df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
 	skb_scrub_packet(skb, xnet);
 
+	err = -ENOSPC;
 	if (!skb_pull(skb, skb_network_offset(skb)))
 		goto free_dst;
 
@@ -381,6 +382,7 @@ static int bareudp6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
 
 	skb_scrub_packet(skb, xnet);
 
+	err = -ENOSPC;
 	if (!skb_pull(skb, skb_network_offset(skb)))
 		goto free_dst;
 
-- 
2.21.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ