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: <20191016171401.16cb1bd5@cakuba.netronome.com>
Date:   Wed, 16 Oct 2019 17:14:01 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Ilias Apalodimas <ilias.apalodimas@...aro.org>
Cc:     netdev@...r.kernel.org, jaswinder.singh@...aro.org,
        davem@...emloft.net, brouer@...hat.com, lorenzo@...nel.org
Subject: Re: [PATCH] net: netsec: Correct dma sync for XDP_TX frames

On Wed, 16 Oct 2019 14:40:32 +0300, Ilias Apalodimas wrote:
> bpf_xdp_adjust_head() can change the frame boundaries. Account for the
> potential shift properly by calculating the new offset before
> syncing the buffer to the device for XDP_TX
> 
> Fixes: ba2b232108d3 ("net: netsec: add XDP support")
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@...aro.org>

Reviewed-by: Jakub Kicinski <jakub.kicinski@...ronome.com>

You should target this to the bpf or net tree (appropriate [PATCH xyz]
marking). Although I must admit it's unclear to me as well whether the
driver changes should be picked up by bpf maintainers or Dave :S

> diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
> index f9e6744d8fd6..41ddd8fff2a7 100644
> --- a/drivers/net/ethernet/socionext/netsec.c
> +++ b/drivers/net/ethernet/socionext/netsec.c
> @@ -847,8 +847,8 @@ static u32 netsec_xdp_queue_one(struct netsec_priv *priv,
>  		enum dma_data_direction dma_dir =
>  			page_pool_get_dma_dir(rx_ring->page_pool);
>  
> -		dma_handle = page_pool_get_dma_addr(page) +
> -			NETSEC_RXBUF_HEADROOM;
> +		dma_handle = page_pool_get_dma_addr(page) + xdpf->headroom +
> +			sizeof(*xdpf);

very nitpick: I'd personally write addr + sizeof(*xdpf) + xdpf->headroom
since that's the order in which they appear in memory

But likely not worth reposting for just that :)

>  		dma_sync_single_for_device(priv->dev, dma_handle, xdpf->len,
>  					   dma_dir);
>  		tx_desc.buf_type = TYPE_NETSEC_XDP_TX;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ