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]
Message-ID: <07987e29-87a0-9a09-bdf0-b5e385d9c55f@gmail.com>
Date:   Mon, 1 Nov 2021 13:54:46 -0700
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Leonard Crestez <cdleonard@...il.com>,
        David Ahern <dsahern@...nel.org>,
        Shuah Khan <shuah@...nel.org>,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Eric Dumazet <edumazet@...gle.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        Kuniyuki Iwashima <kuniyu@...zon.co.jp>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        Jakub Kicinski <kuba@...nel.org>,
        Yuchung Cheng <ycheng@...gle.com>,
        Francesco Ruggeri <fruggeri@...sta.com>,
        Mat Martineau <mathew.j.martineau@...ux.intel.com>,
        Christoph Paasch <cpaasch@...le.com>,
        Ivan Delalande <colona@...sta.com>,
        Priyaranjan Jha <priyarjha@...gle.com>, netdev@...r.kernel.org,
        linux-crypto@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 11/25] tcp: authopt: Implement Sequence Number
 Extension



On 11/1/21 9:34 AM, Leonard Crestez wrote:
> Add a compute_sne function which finds the value of SNE for a certain
> SEQ given an already known "recent" SNE/SEQ. This is implemented using
> the standard tcp before/after macro and will work for SEQ values that
> are without 2^31 of the SEQ for which we know the SNE.

>  }
> +void __tcp_authopt_update_rcv_sne(struct tcp_sock *tp, struct tcp_authopt_info *info, u32 seq);
> +static inline void tcp_authopt_update_rcv_sne(struct tcp_sock *tp, u32 seq)
> +{
> +	struct tcp_authopt_info *info;
> +
> +	if (static_branch_unlikely(&tcp_authopt_needed)) {
> +		rcu_read_lock();
> +		info = rcu_dereference(tp->authopt_info);
> +		if (info)
> +			__tcp_authopt_update_rcv_sne(tp, info, seq);
> +		rcu_read_unlock();
> +	}
> +}
> +void __tcp_authopt_update_snd_sne(struct tcp_sock *tp, struct tcp_authopt_info *info, u32 seq);
> +static inline void tcp_authopt_update_snd_sne(struct tcp_sock *tp, u32 seq)
> +{
> +	struct tcp_authopt_info *info;
> +
> +	if (static_branch_unlikely(&tcp_authopt_needed)) {
> +		rcu_read_lock();
> +		info = rcu_dereference(tp->authopt_info);
> +		if (info)
> +			__tcp_authopt_update_snd_sne(tp, info, seq);
> +		rcu_read_unlock();
> +	}
> +}
>

I would think callers of these helpers own socket lock,
so no rcu_read_lock()/unlock() should be needed.

Perhaps instead
rcu_dereference_protected(tp->authopt_info, lockdep_sock_is_held(sk)); 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ