Thread (8 messages) flat view 8 messages, 3 authors, 2016-10-20

Re: [PATCH] ipv6: fix signedness of tmp_prefered_lft underflow check

From: Jiri Bohac <hidden>
Date: 2016-10-19 14:33:48

Hi,

On Tue, Oct 18, 2016 at 02:25:25PM -0400, David Miller wrote:
Does the check make any sense at all?  I'd say just remove it.
The purpose was to guard against the user updating the
temp_prefered_lft sysctl after this:

        max_desync_factor = min_t(__u32,
                                  idev->cnf.max_desync_factor,
                                  idev->cnf.temp_prefered_lft - regen_advance);

but before this:

	tmp_prefered_lft = idev->cnf.temp_prefered_lft + age -
			    idev->desync_factor;


With enough bad luck, tmp_prefered_lft could underflow and the resulting
preferred lifetime could be almost infinity.

On the other hand, with this check, this situation will result
with the temporary address not being created at all, which might
be even worse. So if you prefer it, just drop the check.
Patch in a follow-up e-mail.

Thanks,

-- 
Jiri Bohac [off-list ref]
SUSE Labs, SUSE CZ
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help