All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Petr Malat <oss@malat.biz>
Cc: netdev@vger.kernel.org, edumazet@google.com, davem@davemloft.net
Subject: Re: [PATCH] ip6mr: Fix lockdep and sparse RCU warnings
Date: Thu, 6 Jun 2024 17:44:27 -0700	[thread overview]
Message-ID: <20240606174427.72db6750@kernel.org> (raw)
In-Reply-To: <20240605195355.363936-1-oss@malat.biz>

On Wed,  5 Jun 2024 21:53:55 +0200 Petr Malat wrote:
> ip6mr_vif_seq_start() must lock RCU even in a case of error, because
> stop callback is called unconditionally.
> 
> When IPV6_MROUTE_MULTIPLE_TABLES is enabled, calls to ip6mr_get_table
> should be done under RCU or RTNL lock. Lock RCU before the call unless
> it's done already or RTNL lock is held.

Patch does not apply, please rebase on:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
if its still legit.

And please add a Fixes tag, since its a fix.

> Signed-off-by: Petr Malat <oss@malat.biz>
> ---
>  net/ipv6/ip6mr.c | 52 +++++++++++++++++++++++++++++++-----------------
>  1 file changed, 34 insertions(+), 18 deletions(-)
> 
> diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
> index cb0ee81a068a..bf6932535d6d 100644
> --- a/net/ipv6/ip6mr.c
> +++ b/net/ipv6/ip6mr.c
> @@ -411,13 +411,14 @@ static void *ip6mr_vif_seq_start(struct seq_file *seq, loff_t *pos)
>  	struct net *net = seq_file_net(seq);
>  	struct mr_table *mrt;
>  
> +	rcu_read_lock();
> +
>  	mrt = ip6mr_get_table(net, RT6_TABLE_DFLT);
>  	if (!mrt)
>  		return ERR_PTR(-ENOENT);

Double check for bugs like missing unlock, too...

      reply	other threads:[~2024-06-07  0:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 19:53 [PATCH] ip6mr: Fix lockdep and sparse RCU warnings Petr Malat
2024-06-07  0:44 ` Jakub Kicinski [this message]

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=20240606174427.72db6750@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss@malat.biz \
    /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.