[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fae47538-b8f8-4b26-86d3-e34aa770b10f@gmail.com>
Date: Thu, 7 Dec 2023 17:03:59 -0800
From: Kui-Feng Lee <sinquersw@...il.com>
To: thinker.li@...il.com, netdev@...r.kernel.org, martin.lau@...ux.dev,
kernel-team@...a.com, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, dsahern@...nel.org, edumazet@...gle.com
Cc: kuifeng@...a.com, syzbot+c15aa445274af8674f41@...kaller.appspotmail.com
Subject: Re: [PATCH net-next] net/ipv6: insert the fib6 gc_link of a fib6_info
only if in fib6.
On 12/7/23 14:16, thinker.li@...il.com wrote:
> From: Kui-Feng Lee <thinker.li@...il.com>
>
> Check f6i->fib6_node before inserting a f6i (fib6_info) to tb6_gc_hlist.
>
> Previously, it checks only if f6i->fib6_table is not NULL, however it is
> not enough. When a f6i is removed from a fib6_table, it's fib6_table is not
> going to be reset. fib6_node is always reset when a f6i is removed from a
> fib6_table and set when a f6i is added to a fib6_table. By checking
> fib6_node, adding a f6i t0 tb6_gc_hlist only if f6i is in the table will be
> enforced.
>
> Fixes: 3dec89b14d37 ("net/ipv6: Remove expired routes with a separated list of routes.")
> Reported-by: syzbot+c15aa445274af8674f41@...kaller.appspotmail.com
> Signed-off-by: Kui-Feng Lee <thinker.li@...il.com>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Cc: dsahern@...nel.org
> ---
> include/net/ip6_fib.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
> index 95ed495c3a40..8477c9ff67ac 100644
> --- a/include/net/ip6_fib.h
> +++ b/include/net/ip6_fib.h
> @@ -512,7 +512,10 @@ static inline void fib6_set_expires_locked(struct fib6_info *f6i,
>
> tb6 = f6i->fib6_table;
> f6i->expires = expires;
> - if (tb6 && !fib6_has_expires(f6i))
> + if (tb6 &&
> + rcu_dereference_protected(f6i->fib6_node,
> + lockdep_is_held(&tb6->tb6_lock)) &&
> + !fib6_has_expires(f6i))
> hlist_add_head(&f6i->gc_link, &tb6->tb6_gc_hlist);
> f6i->fib6_flags |= RTF_EXPIRES;
> }
The following is the result from syzbot for my branch with this patch.
--------------
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger
any issue:
Reported-and-tested-by:
syzbot+c15aa445274af8674f41@...kaller.appspotmail.com
Tested on:
commit: ac408ca0 net/ipv6: insert the fib6 gc_link of a fib6_i..
git tree: https://github.com/ThinkerYzu/linux.git
fix-fib6_set_expires_locked
console output: https://syzkaller.appspot.com/x/log.txt?x=14a55d1ce80000
kernel config: https://syzkaller.appspot.com/x/.config?x=f8715b6ede5c4b90
dashboard link: https://syzkaller.appspot.com/bug?extid=c15aa445274af8674f41
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for
Debian) 2.40
Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.
--------------
How often can syzbot reproduce the issue described in [1]?
[1]
https://lore.kernel.org/all/20231205173250.2982846-1-edumazet@google.com/
Powered by blists - more mailing lists