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: <20200228132941.2c8b8d01@carbon>
Date:   Fri, 28 Feb 2020 13:29:41 +0100
From:   Jesper Dangaard Brouer <jbrouer@...hat.com>
To:     Luigi Rizzo <lrizzo@...gle.com>
Cc:     netdev@...r.kernel.org, toke@...hat.com, davem@...emloft.net,
        hawk@...nel.org, sameehj@...zon.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] netdev attribute to control xdpgeneric skb
 linearization

On Fri, 28 Feb 2020 02:54:35 -0800
Luigi Rizzo <lrizzo@...gle.com> wrote:

> diff --git a/net/core/dev.c b/net/core/dev.c
> index dbbfff123196..c539489d3166 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -4520,9 +4520,12 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
>  	/* XDP packets must be linear and must have sufficient headroom
>  	 * of XDP_PACKET_HEADROOM bytes. This is the guarantee that also
>  	 * native XDP provides, thus we need to do it here as well.
> +	 * For non shared skbs, xdpgeneric_linearize controls linearization.
>  	 */
> -	if (skb_cloned(skb) || skb_is_nonlinear(skb) ||
> -	    skb_headroom(skb) < XDP_PACKET_HEADROOM) {
> +	if (skb_cloned(skb) ||
> +	    (skb->dev->xdpgeneric_linearize &&
> +	     (skb_is_nonlinear(skb) ||
> +	      skb_headroom(skb) < XDP_PACKET_HEADROOM))) {
>  		int hroom = XDP_PACKET_HEADROOM - skb_headroom(skb);
>  		int troom = skb->tail + skb->data_len - skb->end;
>  

Have you checked that calling bpf_xdp_adjust_tail() is not breaking anything?

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ