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] [day] [month] [year] [list]
Date:	Wed, 16 May 2012 11:24:59 +0900
From:	"Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@...esas.com>
To:	Francois Romieu <romieu@...zoreil.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	linux-sh@...r.kernel.org
Subject: Re: [PATCH v3 6/6] net: sh_eth: use NAPI

2012/05/16 3:29, Francois Romieu wrote:
> David Miller <davem@...emloft.net> :
>> From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@...esas.com>
> [...]
>>> I will modify the code as the following. Is it correct?
>>>
>>> 	if (txfree_num) {
>>> 		netif_tx_lock(ndev);
>>> 		if (netif_queue_stopped(ndev))
>>> 			netif_wake_queue(ndev);
>>> 		netif_tx_unlock(ndev);
>>> 	}
>>
>> Yes, and then you don't need that private lock in the start_xmit()
>> method at all, since that method runs with the tx_lock held.
> 
> I agree that the lock should go but:
> 1. something must be done to prevent sh_eth_txfree() being called
>    at the same time from the xmit and poll handlers
> 2. while netif_tx locking above provides an implicit memory barrier,
>    there won't be one in sh_eth_start_xmit once the lock is removed.
>    mdp->dirty_tx changes may thus go unnoticed in sh_eth_start_xmit
> 

Thank you for the review.

I checked tg3.c, and I found a patch to fix the race condition:
commit ID 1b2a72050 : [TG3]: Fix tx race condition

I will check the patch, and I will write such a patch for the sh_eth
driver later.

Best regards,
Yoshihiro Shimoda
--
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