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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ddd3386-58df-4d51-a9c1-e6c184bc12af@CMEXHTCAS1.ad.emulex.com>
Date:	Wed, 15 Jan 2014 10:28:27 +0000
From:	Sathya Perla <Sathya.Perla@...lex.Com>
To:	Ivan Vecera <ivecera@...hat.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	Subramanian Seetharaman <subbu.seetharaman@...lex.com>,
	Ajit Khaparde <Ajit.Khaparde@...lex.Com>
Subject: RE: [PATCH net v2] be2net: add dma_mapping_error() check for
 dma_map_page()

> -----Original Message-----
> From: Ivan Vecera [mailto:ivecera@...hat.com]
> 
> The driver does not check value returned by dma_map_page. The patch
> fixes this.
> 
> v2: Removed the bugfix for non-bug ;-) (thanks Sathya)
> 
> Signed-off-by: Ivan Vecera <ivecera@...hat.com>

Acked-by: Sathya Perla <Sathya.perla@...lex.com>

> ---
>  drivers/net/ethernet/emulex/benet/be_main.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c
> b/drivers/net/ethernet/emulex/benet/be_main.c
> index bf40fda..a37039d 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -1776,6 +1776,7 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
>  	struct be_rx_page_info *page_info = NULL, *prev_page_info = NULL;
>  	struct be_queue_info *rxq = &rxo->q;
>  	struct page *pagep = NULL;
> +	struct device *dev = &adapter->pdev->dev;
>  	struct be_eth_rx_d *rxd;
>  	u64 page_dmaaddr = 0, frag_dmaaddr;
>  	u32 posted, page_offset = 0;
> @@ -1788,9 +1789,15 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
>  				rx_stats(rxo)->rx_post_fail++;
>  				break;
>  			}
> -			page_dmaaddr = dma_map_page(&adapter->pdev->dev, pagep,
> -						    0, adapter->big_page_size,
> +			page_dmaaddr = dma_map_page(dev, pagep, 0,
> +						    adapter->big_page_size,
>  						    DMA_FROM_DEVICE);
> +			if (dma_mapping_error(dev, page_dmaaddr)) {
> +				put_page(pagep);
> +				pagep = NULL;
> +				rx_stats(rxo)->rx_post_fail++;
> +				break;
> +			}
>  			page_info->page_offset = 0;
>  		} else {
>  			get_page(pagep);
> --
> 1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ