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, 01 Feb 2018 10:11:53 -0500 (EST)
From:   David Miller <davem@...emloft.net>
To:     cpaasch@...le.com
Cc:     netdev@...r.kernel.org, edumazet@...gle.com,
        mathew.j.martineau@...ux.intel.com
Subject: Re: [RFC v2 02/14] tcp: Pass sock and skb to tcp_options_write

From: Christoph Paasch <cpaasch@...le.com>
Date: Wed, 31 Jan 2018 16:07:04 -0800

> An upcoming patch adds a configurable, per-socket list of TCP options to
> populate in the TCP header. This requires tcp_options_write() to know the
> socket (to use the options list) and the skb (to provide visibility to the
> packet data for options like TCP_MD5SIG).
> 
> Signed-off-by: Christoph Paasch <cpaasch@...le.com>
> Reviewed-by: Mat Martineau <mathew.j.martineau@...ux.intel.com>
> ---
>  net/ipv4/tcp_output.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index df50c7dc1a43..e598bf54e3fb 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -444,10 +444,14 @@ struct tcp_out_options {
>   * At least SACK_PERM as the first option is known to lead to a disaster
>   * (but it may well be that other scenarios fail similarly).
>   */
> -static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp,
> +static void tcp_options_write(__be32 *ptr, struct sk_buff *skb, struct sock *sk,
>  			      struct tcp_out_options *opts)
>  {
>  	u16 options = opts->options;	/* mungable copy */
> +	struct tcp_sock *tp = NULL;
> +
> +	if (sk_fullsock(sk))
> +		tp = tcp_sk(sk);

This adds a new test to the packet header building fast path,
and all of the call sites know whether they are dealing with
a full sock or not so the test is superfluous.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ