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:	Wed, 11 Dec 2013 20:21:56 -0800
From:	Terry Lam <vtlam@...gle.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	Nandita Dukkipati <nanditad@...gle.com>,
	Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH v2] net-qdisc-hhf: Heavy-Hitter Filter (HHF) qdisc

On Wed, Dec 11, 2013 at 7:51 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> On Wed, 2013-12-11 at 18:10 -0800, Terry Lam wrote:
>
>> +static u32 hhf_time_stamp(void)
>> +{
>> +     return jiffies;
>> +}
>
>
> This is a 32 bit value (For a good reason)
>
>> +{
>> +     struct hh_flow_state *flow, *next;
>> +     unsigned long now = hhf_time_stamp();
>
> stored in a 'unsigned long'
>
>> +
>> +     if (list_empty(head))
>> +             return NULL;
>> +
>> +     list_for_each_entry_safe(flow, next, head, flowchain) {
>> +             unsigned long prev = flow->hit_timestamp + q->hhf_evict_timeout;
>
>
> 32bit + ...
>
>> +
>> +             if (time_before(prev, now)) {
>
> This wont work on 64 bit arches : Wrapping wont be detected anymore.
>
> We keep 32bit variables to lower memory usage,
> this is why we have special macros in include/net/codel.h
>
> Please make sure you test your v3 patch, there is no hurry ;)
>

Thanks for spotting out this, Eric! time_before() needs an "unsigned
long" to avoid compile warning and I was confused by the existence of
both time_before() and time_before64() in jiffies.h.

I agree we should keep 32bit to save memory, so the best solution here
is to put back hhf_time_before() definition.
--
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