netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ipset nf-next] netfilter: ipset: use nfnl_mutex_is_locked
@ 2017-11-30 20:07 Florian Westphal
  2017-12-01 19:14 ` Jozsef Kadlecsik
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2017-11-30 20:07 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

Check that we really hold nfnl mutex here instead of relying on correct
usage alone.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index d5a43cad90f04..1f3c03b3bebf2 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -57,7 +57,7 @@ MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_IPSET);
 
 /* When the nfnl mutex is held: */
 #define ip_set_dereference(p)		\
-	rcu_dereference_protected(p, 1)
+	rcu_dereference_protected(p, lockdep_nfnl_is_held(NFNL_SUBSYS_IPSET))
 #define ip_set(inst, id)		\
 	ip_set_dereference((inst)->ip_set_list)[id]
 
-- 
2.14.3


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

* Re: [PATCH ipset nf-next] netfilter: ipset: use nfnl_mutex_is_locked
  2017-11-30 20:07 [PATCH ipset nf-next] netfilter: ipset: use nfnl_mutex_is_locked Florian Westphal
@ 2017-12-01 19:14 ` Jozsef Kadlecsik
  2017-12-06  8:18   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Jozsef Kadlecsik @ 2017-12-01 19:14 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

Hi Florian,

On Thu, 30 Nov 2017, Florian Westphal wrote:

> Check that we really hold nfnl mutex here instead of relying on correct
> usage alone.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>

Yes, it's better this way :-)

Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>

> ---
> diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
> index d5a43cad90f04..1f3c03b3bebf2 100644
> --- a/net/netfilter/ipset/ip_set_core.c
> +++ b/net/netfilter/ipset/ip_set_core.c
> @@ -57,7 +57,7 @@ MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_IPSET);
>  
>  /* When the nfnl mutex is held: */
>  #define ip_set_dereference(p)		\
> -	rcu_dereference_protected(p, 1)
> +	rcu_dereference_protected(p, lockdep_nfnl_is_held(NFNL_SUBSYS_IPSET))
>  #define ip_set(inst, id)		\
>  	ip_set_dereference((inst)->ip_set_list)[id]
>  
> -- 
> 2.14.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

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

* Re: [PATCH ipset nf-next] netfilter: ipset: use nfnl_mutex_is_locked
  2017-12-01 19:14 ` Jozsef Kadlecsik
@ 2017-12-06  8:18   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2017-12-06  8:18 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: Florian Westphal, netfilter-devel

On Fri, Dec 01, 2017 at 08:14:48PM +0100, Jozsef Kadlecsik wrote:
> Hi Florian,
> 
> On Thu, 30 Nov 2017, Florian Westphal wrote:
> 
> > Check that we really hold nfnl mutex here instead of relying on correct
> > usage alone.
> > 
> > Signed-off-by: Florian Westphal <fw@strlen.de>
> 
> Yes, it's better this way :-)
> 
> Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>

Applied, thanks.

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

end of thread, other threads:[~2017-12-06  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-30 20:07 [PATCH ipset nf-next] netfilter: ipset: use nfnl_mutex_is_locked Florian Westphal
2017-12-01 19:14 ` Jozsef Kadlecsik
2017-12-06  8:18   ` Pablo Neira Ayuso

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).