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: <20151219.125433.148505706922863925.davem@davemloft.net>
Date:	Sat, 19 Dec 2015 12:54:33 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	khoroshilov@...ras.ru
Cc:	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	ldv-project@...uxtesting.org
Subject: Re: [PATCH] natsemi: add checks for dma mapping errors

From: Alexey Khoroshilov <khoroshilov@...ras.ru>
Date: Sat, 19 Dec 2015 15:06:45 +0300

> On 19.12.2015 05:36, David Miller wrote:
>> From: Alexey Khoroshilov <khoroshilov@...ras.ru>
>> Date: Sat, 19 Dec 2015 00:55:37 +0300
>>
>>> @@ -2093,6 +2099,10 @@ static netdev_tx_t start_tx(struct sk_buff
> *skb, struct net_device *dev)
>>>  	np->tx_skbuff[entry] = skb;
>>>  	np->tx_dma[entry] = pci_map_single(np->pci_dev,
>>>  				skb->data,skb->len, PCI_DMA_TODEVICE);
>>> +	if (pci_dma_mapping_error(np->pci_dev, np->tx_dma[entry])) {
>>> +		np->tx_skbuff[entry] = NULL;
>>> +		return NETDEV_TX_BUSY;
>>> +	}
>>>
>>>  	np->tx_ring[entry].addr = cpu_to_le32(np->tx_dma[entry]);
>>>
>>
>> Returning NETDEV_TX_BUSY and freeing the SKB will crash the system.
> 
> I do not quite understand what do you mean by 'freeing the SKB'.
> At least the patch left skb untouched.

Sorry, I misread your patch, I thought I saw a kfree there but
obviously there isn't.

>> NETDEV_TX_BUSY is only for buggy drivers that do not manage their
>> TX ring busy condition correctly, and thus need retries.
> 
> Ok, I will replace NETDEV_TX_BUSY by dropping the packet.

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