* [PATCH] net: netlabel: Use built-in RCU list checking
@ 2020-02-18 18:17 ` madhuparnabhowmik10
0 siblings, 0 replies; 6+ messages in thread
From: madhuparnabhowmik10 @ 2020-02-18 18:17 UTC (permalink / raw)
To: paul, davem
Cc: netdev, linux-security-module, linux-kernel, joel, frextrite,
linux-kernel-mentees, paulmck, Madhuparna Bhowmik
From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
list_for_each_entry_rcu() has built-in RCU and lock checking.
Pass cond argument to list_for_each_entry_rcu() to silence
false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
by default.
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
net/netlabel/netlabel_unlabeled.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index d2e4ab8d1cb1..77bb1bb22c3b 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -207,7 +207,8 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex)
bkt = netlbl_unlhsh_hash(ifindex);
bkt_list = &netlbl_unlhsh_rcu_deref(netlbl_unlhsh)->tbl[bkt];
- list_for_each_entry_rcu(iter, bkt_list, list)
+ list_for_each_entry_rcu(iter, bkt_list, list,
+ lockdep_is_held(&netlbl_unlhsh_lock))
if (iter->valid && iter->ifindex == ifindex)
return iter;
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Linux-kernel-mentees] [PATCH] net: netlabel: Use built-in RCU list checking
@ 2020-02-18 18:17 ` madhuparnabhowmik10
0 siblings, 0 replies; 6+ messages in thread
From: madhuparnabhowmik10 @ 2020-02-18 18:17 UTC (permalink / raw)
To: paul, davem
Cc: paulmck, netdev, linux-kernel, Madhuparna Bhowmik,
linux-security-module, joel, linux-kernel-mentees
From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
list_for_each_entry_rcu() has built-in RCU and lock checking.
Pass cond argument to list_for_each_entry_rcu() to silence
false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
by default.
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
net/netlabel/netlabel_unlabeled.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index d2e4ab8d1cb1..77bb1bb22c3b 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -207,7 +207,8 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex)
bkt = netlbl_unlhsh_hash(ifindex);
bkt_list = &netlbl_unlhsh_rcu_deref(netlbl_unlhsh)->tbl[bkt];
- list_for_each_entry_rcu(iter, bkt_list, list)
+ list_for_each_entry_rcu(iter, bkt_list, list,
+ lockdep_is_held(&netlbl_unlhsh_lock))
if (iter->valid && iter->ifindex == ifindex)
return iter;
--
2.17.1
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] net: netlabel: Use built-in RCU list checking
2020-02-18 18:17 ` [Linux-kernel-mentees] " madhuparnabhowmik10
@ 2020-02-18 20:43 ` David Miller
-1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-02-18 20:43 UTC (permalink / raw)
To: madhuparnabhowmik10
Cc: paul, netdev, linux-security-module, linux-kernel, joel,
frextrite, linux-kernel-mentees, paulmck
From: madhuparnabhowmik10@gmail.com
Date: Tue, 18 Feb 2020 23:47:18 +0530
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> list_for_each_entry_rcu() has built-in RCU and lock checking.
>
> Pass cond argument to list_for_each_entry_rcu() to silence
> false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
> by default.
>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Linux-kernel-mentees] [PATCH] net: netlabel: Use built-in RCU list checking
@ 2020-02-18 20:43 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-02-18 20:43 UTC (permalink / raw)
To: madhuparnabhowmik10
Cc: paul, paulmck, netdev, linux-kernel, linux-security-module, joel,
linux-kernel-mentees
From: madhuparnabhowmik10@gmail.com
Date: Tue, 18 Feb 2020 23:47:18 +0530
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> list_for_each_entry_rcu() has built-in RCU and lock checking.
>
> Pass cond argument to list_for_each_entry_rcu() to silence
> false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
> by default.
>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Applied.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: netlabel: Use built-in RCU list checking
2020-02-18 18:17 ` [Linux-kernel-mentees] " madhuparnabhowmik10
@ 2020-02-18 22:48 ` Paul Moore
-1 siblings, 0 replies; 6+ messages in thread
From: Paul Moore @ 2020-02-18 22:48 UTC (permalink / raw)
To: madhuparnabhowmik10
Cc: davem, netdev, linux-security-module, linux-kernel, joel,
frextrite, linux-kernel-mentees, paulmck
On Tue, Feb 18, 2020 at 1:17 PM <madhuparnabhowmik10@gmail.com> wrote:
>
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> list_for_each_entry_rcu() has built-in RCU and lock checking.
>
> Pass cond argument to list_for_each_entry_rcu() to silence
> false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
> by default.
>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> ---
> net/netlabel/netlabel_unlabeled.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Not that this has much bearing since it's already been merged, but for
what it's worth ...
Acked-by: Paul Moore <paul@paul-moore.com>
> diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
> index d2e4ab8d1cb1..77bb1bb22c3b 100644
> --- a/net/netlabel/netlabel_unlabeled.c
> +++ b/net/netlabel/netlabel_unlabeled.c
> @@ -207,7 +207,8 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex)
>
> bkt = netlbl_unlhsh_hash(ifindex);
> bkt_list = &netlbl_unlhsh_rcu_deref(netlbl_unlhsh)->tbl[bkt];
> - list_for_each_entry_rcu(iter, bkt_list, list)
> + list_for_each_entry_rcu(iter, bkt_list, list,
> + lockdep_is_held(&netlbl_unlhsh_lock))
> if (iter->valid && iter->ifindex == ifindex)
> return iter;
>
> --
> 2.17.1
--
paul moore
www.paul-moore.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Linux-kernel-mentees] [PATCH] net: netlabel: Use built-in RCU list checking
@ 2020-02-18 22:48 ` Paul Moore
0 siblings, 0 replies; 6+ messages in thread
From: Paul Moore @ 2020-02-18 22:48 UTC (permalink / raw)
To: madhuparnabhowmik10
Cc: paulmck, netdev, linux-kernel, linux-security-module, joel,
linux-kernel-mentees, davem
On Tue, Feb 18, 2020 at 1:17 PM <madhuparnabhowmik10@gmail.com> wrote:
>
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> list_for_each_entry_rcu() has built-in RCU and lock checking.
>
> Pass cond argument to list_for_each_entry_rcu() to silence
> false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
> by default.
>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> ---
> net/netlabel/netlabel_unlabeled.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Not that this has much bearing since it's already been merged, but for
what it's worth ...
Acked-by: Paul Moore <paul@paul-moore.com>
> diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
> index d2e4ab8d1cb1..77bb1bb22c3b 100644
> --- a/net/netlabel/netlabel_unlabeled.c
> +++ b/net/netlabel/netlabel_unlabeled.c
> @@ -207,7 +207,8 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex)
>
> bkt = netlbl_unlhsh_hash(ifindex);
> bkt_list = &netlbl_unlhsh_rcu_deref(netlbl_unlhsh)->tbl[bkt];
> - list_for_each_entry_rcu(iter, bkt_list, list)
> + list_for_each_entry_rcu(iter, bkt_list, list,
> + lockdep_is_held(&netlbl_unlhsh_lock))
> if (iter->valid && iter->ifindex == ifindex)
> return iter;
>
> --
> 2.17.1
--
paul moore
www.paul-moore.com
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-02-18 22:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 18:17 [PATCH] net: netlabel: Use built-in RCU list checking madhuparnabhowmik10
2020-02-18 18:17 ` [Linux-kernel-mentees] " madhuparnabhowmik10
2020-02-18 20:43 ` David Miller
2020-02-18 20:43 ` [Linux-kernel-mentees] " David Miller
2020-02-18 22:48 ` Paul Moore
2020-02-18 22:48 ` [Linux-kernel-mentees] " Paul Moore
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.