[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d7ffcd2b-55b0-4084-a18d-49596df8b494@gmail.com>
Date: Thu, 7 Dec 2023 10:36:11 -0800
From: Kui-Feng Lee <sinquersw@...il.com>
To: David Ahern <dsahern@...nel.org>, Eric Dumazet <edumazet@...gle.com>
Cc: patchwork-bot+netdevbpf@...nel.org, Kui-Feng Lee <thinker.li@...il.com>,
davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next] ipv6: add debug checks in fib6_info_release()
On 12/7/23 10:25, David Ahern wrote:
> On 12/7/23 11:22 AM, Eric Dumazet wrote:
>> Feel free to amend the patch, but the issue is that we insert a fib
>> gc_link to a list, then free the fi6 object without removing it first
>> from the external list.
>
> yes, move the insert down:
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index b132feae3393..7257ba0e72b7 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -3762,12 +3762,6 @@ static struct fib6_info
> *ip6_route_info_create(struct fib6_config *cfg,
> if (cfg->fc_flags & RTF_ADDRCONF)
> rt->dst_nocount = true;
>
> - if (cfg->fc_flags & RTF_EXPIRES)
> - fib6_set_expires_locked(rt, jiffies +
> -
> clock_t_to_jiffies(cfg->fc_expires));
> - else
> - fib6_clean_expires_locked(rt);
> -
fib6_set_expires_locked() here actually doesn't insert a fib gc_link
since rt->fib6_table is not assigned yet. The gc_link will
be inserted by fib6_add() being called later.
> if (cfg->fc_protocol == RTPROT_UNSPEC)
> cfg->fc_protocol = RTPROT_BOOT;
> rt->fib6_protocol = cfg->fc_protocol;
> @@ -3824,6 +3818,12 @@ static struct fib6_info
> *ip6_route_info_create(struct fib6_config *cfg,
> } else
> rt->fib6_prefsrc.plen = 0;
>
> +
> + if (cfg->fc_flags & RTF_EXPIRES)
> + fib6_set_expires_locked(rt, jiffies +
> +
> clock_t_to_jiffies(cfg->fc_expires));
> + else
> + fib6_clean_expires_locked(rt);
> return rt;
> out:
> fib6_info_release(rt);
However, this should fix the warning messages.
Powered by blists - more mailing lists