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

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

From: David Miller <davem@davemloft.net>
Date: 2016-10-19 18:58:20

From: Jiri Bohac <redacted>
Date: Wed, 19 Oct 2016 15:16:36 +0200
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;
That's a different problem.

Read the sysctl values of interest into local variables using
READ_ONCE() before the calculations, that way the situation your
describe is impossible.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help