All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix suspicious RCU usage warning
@ 2020-05-13  6:16 madhuparnabhowmik10
  2020-05-13 11:52 ` Stephen Rothwell
  2020-05-13 19:00 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: madhuparnabhowmik10 @ 2020-05-13  6:16 UTC (permalink / raw)
  To: davem, kuznet, yoshfuji, kuba
  Cc: netdev, linux-kernel, sfr, frextrite, joel, paulmck, cai,
	Madhuparna Bhowmik

From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

This patch fixes the following warning:

=============================
WARNING: suspicious RCU usage
5.7.0-rc4-next-20200507-syzkaller #0 Not tainted
-----------------------------
net/ipv6/ip6mr.c:124 RCU-list traversed in non-reader section!!

ipmr_new_table() returns an existing table, but there is no table at
init. Therefore the condition: either holding rtnl or the list is empty
is used.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
 net/ipv6/ip6mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 65a54d74acc1..fbe282bb8036 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -98,7 +98,7 @@ static void ipmr_expire_process(struct timer_list *t);
 #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
 #define ip6mr_for_each_table(mrt, net) \
 	list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list, \
-				lockdep_rtnl_is_held())
+				lockdep_rtnl_is_held() ||  list_empty(&net->ipv6.mr6_tables))
 
 static struct mr_table *ip6mr_mr_table_iter(struct net *net,
 					    struct mr_table *mrt)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix suspicious RCU usage warning
  2020-05-13  6:16 [PATCH] Fix suspicious RCU usage warning madhuparnabhowmik10
@ 2020-05-13 11:52 ` Stephen Rothwell
  2020-05-13 19:00 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2020-05-13 11:52 UTC (permalink / raw)
  To: madhuparnabhowmik10
  Cc: davem, kuznet, yoshfuji, kuba, netdev, linux-kernel, frextrite,
	joel, paulmck, cai

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

Hi all,

On Wed, 13 May 2020 11:46:10 +0530 madhuparnabhowmik10@gmail.com wrote:
>
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> 
> This patch fixes the following warning:
> 
> =============================
> WARNING: suspicious RCU usage
> 5.7.0-rc4-next-20200507-syzkaller #0 Not tainted
> -----------------------------
> net/ipv6/ip6mr.c:124 RCU-list traversed in non-reader section!!
> 
> ipmr_new_table() returns an existing table, but there is no table at
> init. Therefore the condition: either holding rtnl or the list is empty
> is used.
> 
> Suggested-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

Thanks.  Added to my fixes tree from tomorrow (until it turns up
elsewhere).

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix suspicious RCU usage warning
  2020-05-13  6:16 [PATCH] Fix suspicious RCU usage warning madhuparnabhowmik10
  2020-05-13 11:52 ` Stephen Rothwell
@ 2020-05-13 19:00 ` David Miller
  2020-05-14  7:04   ` Madhuparna Bhowmik
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2020-05-13 19:00 UTC (permalink / raw)
  To: madhuparnabhowmik10
  Cc: kuznet, yoshfuji, kuba, netdev, linux-kernel, sfr, frextrite,
	joel, paulmck, cai

From: madhuparnabhowmik10@gmail.com
Date: Wed, 13 May 2020 11:46:10 +0530

> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> 
> This patch fixes the following warning:
> 
> =============================
> WARNING: suspicious RCU usage
> 5.7.0-rc4-next-20200507-syzkaller #0 Not tainted
> -----------------------------
> net/ipv6/ip6mr.c:124 RCU-list traversed in non-reader section!!
> 
> ipmr_new_table() returns an existing table, but there is no table at
> init. Therefore the condition: either holding rtnl or the list is empty
> is used.
> 
> Suggested-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> 
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

Please only provide one signoff line.

Please provide a proper Fixes: tag for this bug fix.

And finally, please make your Subject line more appropriate.  It must
first state the target tree inside of the "[PATCH]" area, the two choices
are "[PATCH net]" and "[PATCH net-next]" and it depends upon which tree
this patch is targetting.

Then your Subject line should also be more descriptive about exactly the
subsystem and area the change is being made to, for this change for
example you could use something like:

	ipv6: Fix suspicious RCU usage warning in ip6mr.

Also, obviously, there are also syzkaller tags you can add to the
commit message as well.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix suspicious RCU usage warning
  2020-05-13 19:00 ` David Miller
@ 2020-05-14  7:04   ` Madhuparna Bhowmik
  2020-05-14 19:50     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Madhuparna Bhowmik @ 2020-05-14  7:04 UTC (permalink / raw)
  To: David Miller
  Cc: madhuparnabhowmik10, kuznet, yoshfuji, kuba, netdev,
	linux-kernel, sfr, frextrite, joel, paulmck, cai

On Wed, May 13, 2020 at 12:00:10PM -0700, David Miller wrote:
> From: madhuparnabhowmik10@gmail.com
> Date: Wed, 13 May 2020 11:46:10 +0530
> 
> > From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> > 
> > This patch fixes the following warning:
> > 
> > =============================
> > WARNING: suspicious RCU usage
> > 5.7.0-rc4-next-20200507-syzkaller #0 Not tainted
> > -----------------------------
> > net/ipv6/ip6mr.c:124 RCU-list traversed in non-reader section!!
> > 
> > ipmr_new_table() returns an existing table, but there is no table at
> > init. Therefore the condition: either holding rtnl or the list is empty
> > is used.
> > 
> > Suggested-by: Jakub Kicinski <kuba@kernel.org>
> > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> > 
> > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> 
> Please only provide one signoff line.
> 
> Please provide a proper Fixes: tag for this bug fix.
> 
> And finally, please make your Subject line more appropriate.  It must
> first state the target tree inside of the "[PATCH]" area, the two choices
> are "[PATCH net]" and "[PATCH net-next]" and it depends upon which tree
> this patch is targetting.
> 
> Then your Subject line should also be more descriptive about exactly the
> subsystem and area the change is being made to, for this change for
> example you could use something like:
> 
> 	ipv6: Fix suspicious RCU usage warning in ip6mr.
> 
> Also, obviously, there are also syzkaller tags you can add to the
> commit message as well.
Sorry for this malformed patch, I have sent a patch with all these
corrections.

Thank you,
Madhuparna

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix suspicious RCU usage warning
  2020-05-14  7:04   ` Madhuparna Bhowmik
@ 2020-05-14 19:50     ` David Miller
  2020-05-16  7:47       ` Madhuparna Bhowmik
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2020-05-14 19:50 UTC (permalink / raw)
  To: madhuparnabhowmik10
  Cc: kuznet, yoshfuji, kuba, netdev, linux-kernel, sfr, frextrite,
	joel, paulmck, cai

From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Date: Thu, 14 May 2020 12:34:09 +0530

> Sorry for this malformed patch, I have sent a patch with all these
> corrections.

It still needs more work, see Jakub's feedback.

Thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix suspicious RCU usage warning
  2020-05-14 19:50     ` David Miller
@ 2020-05-16  7:47       ` Madhuparna Bhowmik
  0 siblings, 0 replies; 6+ messages in thread
From: Madhuparna Bhowmik @ 2020-05-16  7:47 UTC (permalink / raw)
  To: David Miller
  Cc: madhuparnabhowmik10, kuznet, yoshfuji, kuba, netdev,
	linux-kernel, sfr, frextrite, joel, paulmck, cai

On Thu, May 14, 2020 at 12:50:11PM -0700, David Miller wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> Date: Thu, 14 May 2020 12:34:09 +0530
> 
> > Sorry for this malformed patch, I have sent a patch with all these
> > corrections.
> 
> It still needs more work, see Jakub's feedback.
>
Yes, I have sent the v2 of this patch.

Thank you,
Madhuparna

> Thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-16  7:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13  6:16 [PATCH] Fix suspicious RCU usage warning madhuparnabhowmik10
2020-05-13 11:52 ` Stephen Rothwell
2020-05-13 19:00 ` David Miller
2020-05-14  7:04   ` Madhuparna Bhowmik
2020-05-14 19:50     ` David Miller
2020-05-16  7:47       ` Madhuparna Bhowmik

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.