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] [day] [month] [year] [list]
Message-ID: <20220728195003.5dd7cf34@kernel.org>
Date:   Thu, 28 Jul 2022 19:50:03 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     gfree.wind@...look.com
Cc:     edumazet@...gle.com, davem@...emloft.net, yoshfuji@...ux-ipv6.org,
        dsahern@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
        Gao Feng <gfree.wind@...il.com>
Subject: Re: [PATCH net-next 1/1] tcp: Remove useless acceptable check
 because the return vlaue always is 0

On Wed, 27 Jul 2022 06:58:03 +0800 gfree.wind@...look.com wrote:
> From: Gao Feng <gfree.wind@...il.com>
> 
> The conn_request function of IPv4 and IPv6 always returns 0, so it's
> useless to check for acceptable.

I don't think this is an improvement. If the function returns 
a value we should not be ignoring it.

> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 3ec4edc37313..82a875efd1e8 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -6453,12 +6453,11 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
>  			 */
>  			rcu_read_lock();
>  			local_bh_disable();
> -			acceptable = icsk->icsk_af_ops->conn_request(sk, skb) >= 0;
> +			/* TCP's conn_request always returns 0. */
> +			icsk->icsk_af_ops->conn_request(sk, skb);
>  			local_bh_enable();
>  			rcu_read_unlock();
>  
> -			if (!acceptable)
> -				return 1;
>  			consume_skb(skb);
>  			return 0;
>  		}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ