Netdev List
 help / color / mirror / Atom feed
From: Stefan Wiehler <stefan.wiehler@nokia.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	David Ahern <dsahern@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Petr Malat <oss@malat.biz>
Subject: Re: [PATCH net v2] ip6mr: Fix lockdep and sparse RCU warnings
Date: Tue, 1 Oct 2024 16:36:28 +0200	[thread overview]
Message-ID: <68ee33a7-c60e-48b9-b362-c991bdcf675f@nokia.com> (raw)
In-Reply-To: <CANn89iLC5SgSgCEJfu7npgK22h+U3zOJzAd1kv0drEOmF24a3A@mail.gmail.com>

> This could be a lockdep annotation error then, at least for
> RT6_TABLE_DFLT, oh well.

As you have already explained, we can ignore the ip6mr_vif_seq_start() error
path, so the issue boils down to ip6mr_get_table() being called without
entering a RCU read-side critical section from these 4 functions:
ipmr_vif_seq_start(), ip6mr_ioctl(), ip6mr_compat_ioctl() and
ip6mr_get_route(). It is my understanding that in none of these four cases the
RTNL lock is held either; at least according to the RCU-lockdep splat we
clearly see that this is not the case in ip6mr_ioctl()  – but please correct me
if I'm wrong.

> Note that net/ipv4/ipmr.c would have a similar issue.

Yes, looks indeed like that :-/

> Please split your patch in small units, their Fixes: tags are likely
> different, and if some code breaks something,
> fixing the issue will be easier.
> 
> The changelog seemed to only address the first ip6mr_vif_seq_start() part.

If you prefer that I can split the change into 4 commits addressing each of the
4 functions mentioned before.

Kind regards,

Stefan

  reply	other threads:[~2024-10-01 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 10:01 [PATCH net v2] ip6mr: Fix lockdep and sparse RCU warnings Stefan Wiehler
2024-10-01 10:34 ` Eric Dumazet
2024-10-01 12:50   ` Stefan Wiehler
2024-10-01 13:26     ` Eric Dumazet
2024-10-01 14:36       ` Stefan Wiehler [this message]
2024-10-01 14:39         ` ericnetdev dumazet

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=68ee33a7-c60e-48b9-b362-c991bdcf675f@nokia.com \
    --to=stefan.wiehler@nokia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss@malat.biz \
    --cc=pabeni@redhat.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