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:	Fri, 27 Feb 2009 23:51:05 +0800
From:	"Guo-Fu Tseng" <cooldavid@...ldavid.org>
To:	roel kluin <roel.kluin@...il.com>
Cc:	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] net: more timeouts that reach -1

On Fri, 27 Feb 2009 16:37:30 +0100, roel kluin wrote
> On Fri, Feb 27, 2009 at 12:43 PM, Guo-Fu Tseng <cooldavid@...ldavid.org> wrote:
> > There should be no difference after this modification.
> > The return value of this function is: "limit > 0 ? limit : 0;"
> 
> There is:
> In the last iteration limit is 1 during the test before it is decremented to 0.
> 
> rxdesc = rxring->desc;
> rxdesc += i;
> 
> If then we break out of the loop by the 'goto out;', we continue with:
> 
> out:
>         atomic_set(&rxring->next_to_clean, i);
> 
> out_inc:
>         atomic_inc(&jme->rx_cleaning);
> 
> but since limit is already decremented, 0 is returned.
> 
> >
> > Guo-Fu Tseng
> >
> 
> Roel
I see.
But the correct patch should be following one, right?

===================================================================
--- jme.c	(revision 580)
+++ jme.c	(working copy)
@@ -958,13 +958,14 @@
 		goto out_inc;
 
 	i = atomic_read(&rxring->next_to_clean);
-	while (limit-- > 0) {
+	while (limit > 0) {
 		rxdesc = rxring->desc;
 		rxdesc += i;
 
 		if ((rxdesc->descwb.flags & RXWBFLAG_OWN) ||
 		!(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL))
 			goto out;
+		--limit;
 
 		desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT;
 



Guo-Fu Tseng

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