Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH][next] netfilter: synproxy: ensure zero is returned on non-error return path
@ 2019-06-18 14:13 Colin King
  2019-06-18 14:15 ` Colin Ian King
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-06-18 14:13 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
	David S . Miller, netfilter-devel, coreteam, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently function nf_synproxy_ipv6_init returns an uninitialized
garbage value in variable ret on a successful return.  Fix this by
returning zero on success.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: d7f9b2f18eae ("netfilter: synproxy: extract SYNPROXY infrastructure from {ipt, ip6t}_SYNPROXY")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/netfilter/nf_synproxy_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
index 50677285f82e..701f880d01e6 100644
--- a/net/netfilter/nf_synproxy_core.c
+++ b/net/netfilter/nf_synproxy_core.c
@@ -1223,7 +1223,7 @@ nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net)
 	}
 
 	snet->hook_ref6++;
-	return err;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(nf_synproxy_ipv6_init);
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] netfilter: synproxy: ensure zero is returned on non-error return path
  2019-06-18 14:13 [PATCH][next] netfilter: synproxy: ensure zero is returned on non-error return path Colin King
@ 2019-06-18 14:15 ` Colin Ian King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin Ian King @ 2019-06-18 14:15 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
	David S . Miller, netfilter-devel, coreteam, netdev
  Cc: kernel-janitors, linux-kernel

On 18/06/2019 15:13, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently function nf_synproxy_ipv6_init returns an uninitialized
> garbage value in variable ret on a successful return.  Fix this by
> returning zero on success.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: d7f9b2f18eae ("netfilter: synproxy: extract SYNPROXY infrastructure from {ipt, ip6t}_SYNPROXY")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/netfilter/nf_synproxy_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
> index 50677285f82e..701f880d01e6 100644
> --- a/net/netfilter/nf_synproxy_core.c
> +++ b/net/netfilter/nf_synproxy_core.c
> @@ -1223,7 +1223,7 @@ nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net)
>  	}
>  
>  	snet->hook_ref6++;
> -	return err;
> +	return 0;
>  }
>  EXPORT_SYMBOL_GPL(nf_synproxy_ipv6_init);
>  
> 
Scratch that, I've noticed the same issue in the ipv4 code too. I'll
send a V2.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 14:13 [PATCH][next] netfilter: synproxy: ensure zero is returned on non-error return path Colin King
2019-06-18 14:15 ` Colin Ian King

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox