[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161019.145816.259194714319437266.davem@davemloft.net>
Date: Wed, 19 Oct 2016 14:58:16 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: jbohac@...e.cz
Cc: julia.lawall@...6.fr, kuznet@....inr.ac.ru, jmorris@...ei.org,
yoshfuji@...ux-ipv6.org, kaber@...sh.net, netdev@...r.kernel.org,
kbuild-all@...org
Subject: Re: [PATCH] ipv6: fix signedness of tmp_prefered_lft underflow
check
From: Jiri Bohac <jbohac@...e.cz>
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.
Powered by blists - more mailing lists