From: Ido Schimmel <idosch@nvidia.com>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: David Ahern <dsahern@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Amit Cohen <amcohen@nvidia.com>,
Jiri Pirko <jiri@resnulli.us>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
netdev@vger.kernel.org,
syzbot+cb2aa2390ac024e25f5c@syzkaller.appspotmail.com
Subject: Re: [PATCH v1 net 1/2] ipv4: fib: Don't dump dying fib_info in fib_leaf_notify().
Date: Thu, 11 Jun 2026 15:33:26 +0300 [thread overview]
Message-ID: <20260611123326.GA924647@shredder> (raw)
In-Reply-To: <20260610061744.2030996-2-kuniyu@google.com>
On Wed, Jun 10, 2026 at 06:17:18AM +0000, Kuniyuki Iwashima wrote:
> syzbot reported use-after-free in nsim_fib4_prepare_event(). [0]
>
> The problem is that the following functions call fib_info_hold() /
> refcount_inc() while dumping fib_info under RCU, which is unsafe.
>
> * mlxsw_sp_router_fib4_event()
> * rocker_router_fib_event()
> * nsim_fib4_prepare_event()
>
> refcount_inc_not_zero() must be used, but it would be too late
> there.
>
> Let's guarantee the lifetime of fib_info in fib_leaf_notify().
>
> Note that IPv6 does not need the corresponding change since
> fib6_table_dump() holds fib6_table.tb6_lock.
[...]
> Fixes: 0ae3eb7b4611 ("netdevsim: fib: Perform the route programming in a non-atomic context")
> Fixes: c3852ef7f2f8 ("ipv4: fib: Replay events when registering FIB notifier")
> Reported-by: syzbot+cb2aa2390ac024e25f5c@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/netdev/6a290011.39669fcc.33b062.00b1.GAE@google.com/
> Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Thanks!
next prev parent reply other threads:[~2026-06-11 12:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 6:17 [PATCH v1 net 0/2] net: fib: Fix two use-after-free in drivers during RCU dump Kuniyuki Iwashima
2026-06-10 6:17 ` [PATCH v1 net 1/2] ipv4: fib: Don't dump dying fib_info in fib_leaf_notify() Kuniyuki Iwashima
2026-06-11 12:33 ` Ido Schimmel [this message]
2026-06-11 14:30 ` David Ahern
2026-06-10 6:17 ` [PATCH v1 net 2/2] net: fib_rules: Don't dump dying fib_rule in fib_rules_dump() Kuniyuki Iwashima
2026-06-11 12:33 ` Ido Schimmel
2026-06-11 14:30 ` David Ahern
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=20260611123326.GA924647@shredder \
--to=idosch@nvidia.com \
--cc=amcohen@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+cb2aa2390ac024e25f5c@syzkaller.appspotmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox