netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Wei Wang <weiwan@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, syzbot <syzkaller@googlegroups.com>,
	David Ahern <dsahern@kernel.org>, Petr Machata <petrm@nvidia.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net v2] ipv6: fix suspecious RCU usage warning
Date: Wed, 10 Mar 2021 11:54:47 +0200	[thread overview]
Message-ID: <YEiXZ2K7GTVNE9F0@shredder.lan> (raw)
In-Reply-To: <20210310022035.2908294-1-weiwan@google.com>

On Tue, Mar 09, 2021 at 06:20:35PM -0800, Wei Wang wrote:
> Syzbot reported the suspecious RCU usage in nexthop_fib6_nh() when
> called from ipv6_route_seq_show(). The reason is ipv6_route_seq_start()
> calls rcu_read_lock_bh(), while nexthop_fib6_nh() calls
> rcu_dereference_rtnl().
> The fix proposed is to add a variant of nexthop_fib6_nh() to use
> rcu_dereference_bh_rtnl() for ipv6_route_seq_show().
> 
> The reported trace is as follows:
> ./include/net/nexthop.h:416 suspicious rcu_dereference_check() usage!
> 
> other info that might help us debug this:
> 
> rcu_scheduler_active = 2, debug_locks = 1
> 2 locks held by syz-executor.0/17895:
>      at: seq_read+0x71/0x12a0 fs/seq_file.c:169
>      at: seq_file_net include/linux/seq_file_net.h:19 [inline]
>      at: ipv6_route_seq_start+0xaf/0x300 net/ipv6/ip6_fib.c:2616

[...]

> 
> Fixes: f88d8ea67fbdb ("ipv6: Plumb support for nexthop object in a fib6_info")
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Signed-off-by: Wei Wang <weiwan@google.com>
> Cc: David Ahern <dsahern@kernel.org>
> Cc: Ido Schimmel <idosch@idosch.org>
> Cc: Petr Machata <petrm@nvidia.com>
> Cc: Eric Dumazet <edumazet@google.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

  reply	other threads:[~2021-03-10  9:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10  2:20 [PATCH net v2] ipv6: fix suspecious RCU usage warning Wei Wang
2021-03-10  9:54 ` Ido Schimmel [this message]
2021-03-10 16:15 ` David Ahern
2021-03-10 20:50 ` patchwork-bot+netdevbpf

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=YEiXZ2K7GTVNE9F0@shredder.lan \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=syzkaller@googlegroups.com \
    --cc=weiwan@google.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;
as well as URLs for NNTP newsgroup(s).