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: <25e057c00902270737x529fb5b8m2fdbb044fa75ab0d@mail.gmail.com>
Date:	Fri, 27 Feb 2009 16:37:30 +0100
From:	roel kluin <roel.kluin@...il.com>
To:	cooldavid@...ldavid.org
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, Feb 27, 2009 at 12:43 PM, Guo-Fu Tseng <cooldavid@...ldavid.org> wrote:
> On Wed, 25 Feb 2009 12:15:57 +0100, Roel Kluin wrote
>> These were not previously reported by me.
>> ------------------------------>8-------------8<---------------------------------
>> with while (timeout-- > 0); timeout reaches -1 after the loop, so the tests
>> below are off by one.
>>
>> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
>> ---

>> diff --git a/drivers/net/jme.c b/drivers/net/jme.c
>> index 08b3405..0173ed0 100644
>> --- a/drivers/net/jme.c
>> +++ b/drivers/net/jme.c
>> @@ -957,7 +957,8 @@ jme_process_receive(struct jme_adapter *jme, int limit)
>>               goto out_inc;
>>
>>       i = atomic_read(&rxring->next_to_clean);
>> -     while (limit-- > 0) {
>> +     while (limit > 0) {
>> +             limit--;
>>               rxdesc = rxring->desc;
>>               rxdesc += i;
>>
> 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
--
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