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: <CAHaKRvJDZJjuv4sALmQAotk5EUMfYPiLN=8_noWCRQYOW+bxSA@mail.gmail.com>
Date:	Fri, 27 Sep 2013 13:28:06 -0700
From:	Paul Marks <pmarks@...gle.com>
To:	Paul Marks <pmarks@...gle.com>, netdev@...r.kernel.org,
	davem@...emloft.net, yoshfuji@...ux-ipv6.org,
	Lorenzo Colitti <lorenzo@...gle.com>
Subject: Re: [PATCH] ipv6: Fix preferred_lft not updating in some cases

On Fri, Sep 27, 2013 at 1:16 AM, Hannes Frederic Sowa
<hannes@...essinduktion.org> wrote:
> On Wed, Sep 25, 2013 at 03:12:55PM -0700, Paul Marks wrote:
>> -                                     if (prefered_lft != ifp->prefered_lft) {
>
> Wouldn't the easiest solution be to just drop this if and execute the two
> lines below unconditionally?

Yes, that's also correct.  But is it not better to have simpler code
than shorter diffs?  Should we transliterate English to C, or think
about what the algorithm is actually doing?  The fact that this bug
has gone unnoticed provides some evidence that the code may have been
too complicated.

>> +                             const u32 minimum_lft = min(
>> +                                     stored_lft, (u32)MIN_VALID_LIFETIME);
>> +                             valid_lft = max(valid_lft, minimum_lft);
>
> Quick question: Don't we need a prefered_lft = min(preferred_lft, valid_lft)
> here?

The invariant is (preferred_lft <= valid_lft), and valid_lft can only
get bigger, so I don't think there's a problem.
--
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