Message ID | 20231024212312.299370-2-alexhenrie24@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | bfbf81b31093e0dc3d61b390a9bd0904d3bf5374 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: ipv6/addrconf: ensure that temporary addresses' preferred lifetimes are in the valid range | expand |
Tue, Oct 24, 2023 at 11:23:07PM CEST, alexhenrie24@gmail.com wrote: >Without this patch, there is nothing to stop the preferred lifetime of a >temporary address from being greater than its valid lifetime. If that >was the case, the valid lifetime was effectively ignored. > Sounds like a bugfix, correct? In that case, could you please provide a proper Fixes tag and target -net tree? >Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> >--- > net/ipv6/addrconf.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c >index c2d471ad7922..26aedaab3647 100644 >--- a/net/ipv6/addrconf.c >+++ b/net/ipv6/addrconf.c >@@ -1399,6 +1399,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, bool block) > idev->cnf.temp_valid_lft + age); > cfg.preferred_lft = cnf_temp_preferred_lft + age - idev->desync_factor; > cfg.preferred_lft = min_t(__u32, ifp->prefered_lft, cfg.preferred_lft); >+ cfg.preferred_lft = min_t(__u32, cfg.valid_lft, cfg.preferred_lft); > > cfg.plen = ifp->prefix_len; > tmp_tstamp = ifp->tstamp; >-- >2.42.0 > >
On Wed, Oct 25, 2023 at 6:23 AM Jiri Pirko <jiri@resnulli.us> wrote: > > Tue, Oct 24, 2023 at 11:23:07PM CEST, alexhenrie24@gmail.com wrote: > >Without this patch, there is nothing to stop the preferred lifetime of a > >temporary address from being greater than its valid lifetime. If that > >was the case, the valid lifetime was effectively ignored. > > > > Sounds like a bugfix, correct? In that case, could you please > provide a proper Fixes tag and target -net tree? Paolo requested no Fixes tag, and Jakub seemed to agree: https://lore.kernel.org/all/60d9d5f57fdb55a27748996d807712c680c4e7f9.camel@redhat.com/ https://lore.kernel.org/all/20230830182852.175e0ac2@kernel.org/ Which is fine by me. These changes are not important enough to backport. -Alex
On 10/24/23 3:23 PM, Alex Henrie wrote: > Without this patch, there is nothing to stop the preferred lifetime of a > temporary address from being greater than its valid lifetime. If that > was the case, the valid lifetime was effectively ignored. > > Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> > --- > net/ipv6/addrconf.c | 1 + > 1 file changed, 1 insertion(+) > Reviewed-by: David Ahern <dsahern@kernel.org>
Wed, Oct 25, 2023 at 06:28:00PM CEST, alexhenrie24@gmail.com wrote: >On Wed, Oct 25, 2023 at 6:23 AM Jiri Pirko <jiri@resnulli.us> wrote: >> >> Tue, Oct 24, 2023 at 11:23:07PM CEST, alexhenrie24@gmail.com wrote: >> >Without this patch, there is nothing to stop the preferred lifetime of a >> >temporary address from being greater than its valid lifetime. If that >> >was the case, the valid lifetime was effectively ignored. >> > >> >> Sounds like a bugfix, correct? In that case, could you please >> provide a proper Fixes tag and target -net tree? > >Paolo requested no Fixes tag, and Jakub seemed to agree: > >https://lore.kernel.org/all/60d9d5f57fdb55a27748996d807712c680c4e7f9.camel@redhat.com/ Okay, makes sense. Reviewed-by: Jiri Pirko <jiri@nvidia.com>
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index c2d471ad7922..26aedaab3647 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -1399,6 +1399,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, bool block) idev->cnf.temp_valid_lft + age); cfg.preferred_lft = cnf_temp_preferred_lft + age - idev->desync_factor; cfg.preferred_lft = min_t(__u32, ifp->prefered_lft, cfg.preferred_lft); + cfg.preferred_lft = min_t(__u32, cfg.valid_lft, cfg.preferred_lft); cfg.plen = ifp->prefix_len; tmp_tstamp = ifp->tstamp;
Without this patch, there is nothing to stop the preferred lifetime of a temporary address from being greater than its valid lifetime. If that was the case, the valid lifetime was effectively ignored. Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> --- net/ipv6/addrconf.c | 1 + 1 file changed, 1 insertion(+)