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]
Date:	Tue, 30 Jul 2013 18:01:51 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	nhorman@...driver.com
Cc:	netdev@...r.kernel.org, romieu@...zoreil.com
Subject: Re: [net PATCH v3] 8139cp: Add dma_mapping_error checking

From: Neil Horman <nhorman@...driver.com>
Date: Mon, 29 Jul 2013 13:05:35 -0400

> @@ -716,6 +722,22 @@ static inline u32 cp_tx_vlan_tag(struct sk_buff *skb)
>  		TxVlanTag | swab16(vlan_tx_tag_get(skb)) : 0x00;
>  }
>  
> +static void unwind_rx_frag_mapping(struct cp_private *cp, struct sk_buff *skb,
> +				   int first, int entry_last)
> +{
> +	int frag, index;
> +	struct cp_desc *txd;
> +	skb_frag_t *this_frag;
> +	for (frag = 0; frag+first < entry_last; frag++) {
> +		index = first+frag;
> +		cp->tx_skb[index] = NULL;
> +		txd = &cp->tx_ring[index];
> +		this_frag = &skb_shinfo(skb)->frags[frag];
> +		dma_unmap_single(&cp->pdev->dev, le64_to_cpu(txd->addr),
> +				 skb_frag_size(this_frag), PCI_DMA_TODEVICE);
> +	}
> +}

This is using PCI_DMA_TODEVICE, so seems to be dealing with TX mappings.
Yet the function is named "unwind_rx_frame_mapping()".

> @@ -799,6 +827,11 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
>  			mapping = dma_map_single(&cp->pdev->dev,
>  						 skb_frag_address(this_frag),
>  						 len, PCI_DMA_TODEVICE);
> +			if (dma_mapping_error(&cp->pdev->dev, mapping)) {
> +				unwind_rx_frag_mapping(cp, skb, first_entry, entry);
> +				goto out_dma_error;
> +			}

And you're invoking it from the cp_start_xmit() function, which further
confirms the incorrect function name :-)

Please fix this and resubmit, thanks.
--
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