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]
Date:   Mon, 7 Jan 2019 13:48:16 +0100
From:   Christian Borntraeger <borntraeger@...ibm.com>
To:     Willem de Bruijn <willemdebruijn.kernel@...il.com>,
        netdev@...r.kernel.org
Cc:     davem@...emloft.net, idosch@...sch.org,
        Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net] tap: call skb_probe_transport_header after setting
 skb->dev

On 30.12.2018 23:21, Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@...gle.com>
> 
> The BPF flow dissector expects either skb->sk or skb->dev set on
> all skbs. Delay flow dissection until after skb->dev is set.
> 
> This requires calling from within an rcu read-side critical section.
> That is fine, see also the call from tun_xdp_one.
> 
> Fixes: d0e13a1488ad ("flow_dissector: lookup netns by skb->sk if skb->dev is NULL")
> Reported-by: Christian Borntraeger <borntraeger@...ibm.com>
> Signed-off-by: Willem de Bruijn <willemb@...gle.com>

Already too late, but
Tested-by: Christian Borntraeger <borntraeger@...ibm.com>

> ---
>  drivers/net/tap.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/tap.c b/drivers/net/tap.c
> index 443b2694130c..c0b52e48f0e6 100644
> --- a/drivers/net/tap.c
> +++ b/drivers/net/tap.c
> @@ -1177,8 +1177,6 @@ static int tap_get_user_xdp(struct tap_queue *q, struct xdp_buff *xdp)
>  			goto err_kfree;
>  	}
>  
> -	skb_probe_transport_header(skb, ETH_HLEN);
> -
>  	/* Move network header to the right position for VLAN tagged packets */
>  	if ((skb->protocol == htons(ETH_P_8021Q) ||
>  	     skb->protocol == htons(ETH_P_8021AD)) &&
> @@ -1189,6 +1187,7 @@ static int tap_get_user_xdp(struct tap_queue *q, struct xdp_buff *xdp)
>  	tap = rcu_dereference(q->tap);
>  	if (tap) {
>  		skb->dev = tap->dev;
> +		skb_probe_transport_header(skb, ETH_HLEN);
>  		dev_queue_xmit(skb);
>  	} else {
>  		kfree_skb(skb);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ