All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Eric Dumazet <edumazet@google.com>, Kui-Feng Lee <sinquersw@gmail.com>
Cc: patchwork-bot+netdevbpf@kernel.org,
	Kui-Feng Lee <thinker.li@gmail.com>,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH net-next] ipv6: add debug checks in fib6_info_release()
Date: Thu, 7 Dec 2023 11:26:40 -0700	[thread overview]
Message-ID: <bf30c6ec-d8cf-4093-a8e8-44fbaab06803@kernel.org> (raw)
In-Reply-To: <590c27ae-c583-4404-ace7-ea68548d07a2@kernel.org>

On 12/7/23 11:25 AM, 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);
> -
>         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);


and then failure to insert into the table needs to remove it before the
release too.

  reply	other threads:[~2023-12-07 18:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 17:32 [PATCH net-next] ipv6: add debug checks in fib6_info_release() Eric Dumazet
2023-12-06  3:41 ` David Ahern
2023-12-07  3:10 ` patchwork-bot+netdevbpf
2023-12-07 13:29   ` Eric Dumazet
2023-12-07 16:43     ` Kui-Feng Lee
2023-12-07 18:06     ` Kui-Feng Lee
2023-12-07 18:10       ` Eric Dumazet
2023-12-07 18:19         ` Kui-Feng Lee
2023-12-07 18:22           ` Eric Dumazet
2023-12-07 18:25             ` David Ahern
2023-12-07 18:26               ` David Ahern [this message]
2023-12-07 18:36               ` Kui-Feng Lee
2023-12-07 18:40                 ` Kui-Feng Lee
2023-12-07 19:00                   ` Kui-Feng Lee
2023-12-07 19:05                     ` Eric Dumazet
2023-12-07 19:08                       ` Kui-Feng Lee
2023-12-07 19:14                         ` Eric Dumazet
2023-12-07 18:46             ` Kui-Feng Lee
2023-12-07 18:55               ` Eric Dumazet
2023-12-07 23:02 ` Kui-Feng Lee
2023-12-08  9:18   ` Eric Dumazet
2023-12-08 18:20     ` Kui-Feng Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf30c6ec-d8cf-4093-a8e8-44fbaab06803@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patchwork-bot+netdevbpf@kernel.org \
    --cc=sinquersw@gmail.com \
    --cc=thinker.li@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.