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: <CH2PR02MB7000EDAE2A7D85D50A52EE81C7380@CH2PR02MB7000.namprd02.prod.outlook.com>
Date:   Fri, 10 Jan 2020 15:26:10 +0000
From:   Radhey Shyam Pandey <radheys@...inx.com>
To:     Andre Przywara <andre.przywara@....com>,
        "David S . Miller" <davem@...emloft.net>
CC:     Michal Simek <michals@...inx.com>,
        Robert Hancock <hancock@...systems.ca>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 04/14] net: axienet: Improve DMA error handling

> -----Original Message-----
> From: Andre Przywara <andre.przywara@....com>
> Sent: Friday, January 10, 2020 5:24 PM
> To: David S . Miller <davem@...emloft.net>; Radhey Shyam Pandey
> <radheys@...inx.com>
> Cc: Michal Simek <michals@...inx.com>; Robert Hancock
> <hancock@...systems.ca>; netdev@...r.kernel.org; linux-arm-
> kernel@...ts.infradead.org; linux-kernel@...r.kernel.org
> Subject: [PATCH 04/14] net: axienet: Improve DMA error handling
> 
> Since 0 is a valid DMA address, we cannot use the physical address to
> check whether a TX descriptor is valid and is holding a DMA mapping.
> 
> Use the "cntrl" member of the descriptor to make this decision, as it
> contains at least the length of the buffer, so 0 points to an
> uninitialised buffer.
> 
> Signed-off-by: Andre Przywara <andre.przywara@....com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@...inx.com>

> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 7e90044cf2d9..ec5d01adc1d5 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -570,7 +570,7 @@ static void axienet_start_xmit_done(struct
> net_device *ndev)
>  				DMA_TO_DEVICE);
>  		if (cur_p->skb)
>  			dev_consume_skb_irq(cur_p->skb);
> -		/*cur_p->phys = 0;*/
> +		cur_p->cntrl = 0;
>  		cur_p->app0 = 0;
>  		cur_p->app1 = 0;
>  		cur_p->app2 = 0;
> @@ -1557,7 +1557,7 @@ static void axienet_dma_err_handler(unsigned
> long data)
> 
>  	for (i = 0; i < lp->tx_bd_num; i++) {
>  		cur_p = &lp->tx_bd_v[i];
> -		if (cur_p->phys)
> +		if (cur_p->cntrl)
>  			dma_unmap_single(ndev->dev.parent, cur_p->phys,
>  					 (cur_p->cntrl &
> 
> XAXIDMA_BD_CTRL_LENGTH_MASK),
> --
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ