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:	Thu, 4 Mar 2010 10:34:15 -0600
From:	Kumar Gala <galak@...nel.crashing.org>
To:	Anton Vorontsov <avorontsov@...mvista.com>
Cc:	Martyn Welch <martyn.welch@...com>,
	David Miller <davem@...emloft.net>,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Sandeep Gopalpet <Sandeep.Kumar@...escale.com>,
	linuxppc-dev list <linuxppc-dev@...abs.org>,
	Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] gianfar: Fix TX ring processing on SMP machines


On Mar 4, 2010, at 2:41 AM, David Miller wrote:

> From: Anton Vorontsov <avorontsov@...mvista.com>
> Date: Wed, 3 Mar 2010 21:18:58 +0300
> 
>> Starting with commit a3bc1f11e9b867a4f49505 ("gianfar: Revive SKB
>> recycling") gianfar driver sooner or later stops transmitting any
>> packets on SMP machines.
>> 
>> start_xmit() prepares new skb for transmitting, generally it does
>> three things:
>> 
>> 1. sets up all BDs (marks them ready to send), except the first one.
>> 2. stores skb into tx_queue->tx_skbuff so that clean_tx_ring()
>>   would cleanup it later.
>> 3. sets up the first BD, i.e. marks it ready.
>> 
>> Here is what clean_tx_ring() does:
>> 
>> 1. reads skbs from tx_queue->tx_skbuff
>> 2. checks if the *last* BD is ready. If it's still ready [to send]
>>   then it it isn't transmitted, so clean_tx_ring() returns.
>>   Otherwise it actually cleanups BDs. All is OK.
>> 
>> Now, if there is just one BD, code flow:
>> 
>> - start_xmit(): stores skb into tx_skbuff. Note that the first BD
>>  (which is also the last one) isn't marked as ready, yet.
>> - clean_tx_ring(): sees that skb is not null, *and* its lstatus
>>  says that it is NOT ready (like if BD was sent), so it cleans
>>  it up (bad!)
>> - start_xmit(): marks BD as ready [to send], but it's too late.
>> 
>> We can fix this simply by reordering lstatus/tx_skbuff writes.
>> 
>> Reported-by: Martyn Welch <martyn.welch@...com>
>> Bisected-by: Paul Gortmaker <paul.gortmaker@...driver.com>
>> Signed-off-by: Anton Vorontsov <avorontsov@...mvista.com>
>> Tested-by: Paul Gortmaker <paul.gortmaker@...driver.com>
>> Tested-by: Martyn Welch <martyn.welch@...com>
> 
> Applied.

Anton,

Once this makes it into Linus's tree can you make sure we get it added to -stable.

- k--
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