All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: dledford@redhat.com, jgg@ziepe.ca, davem@davemloft.net,
	pablo@netfilter.org, kadlec@blackhole.kfki.hu, fw@strlen.de,
	pshelar@ovn.org, johannes@sipsolutions.net, paul@paul-moore.com,
	sds@tycho.nsa.gov, eparis@parisplace.org, jmorris@namei.org,
	serge@hallyn.com, leon@kernel.org, yuval.shaia@oracle.com,
	parav@mellanox.com, danielj@mellanox.com, ktkhai@virtuozzo.com,
	majd@mellanox.com, nicolas.dichtel@6wind.com,
	vyasevic@redhat.com, paulmck@linux.vnet.ibm.com,
	vyasevich@gmail.com, gregkh@linuxfoundation.org,
	daniel@iogearbox.net, jakub.kicinski@netronome.com,
	ast@kernel.org, brouer@redhat.com, linux@rasmusvillemoes.dk,
	john.fastabend@gmail.com, dsahern@gmail.com, jiri@mellanox.com,
	idosch@mellanox.com, vvs@virtuozzo.com, avagin@virtuozzo.com,
	roman.kapl@sysgo.com, lucien.xin@gmail.com,
	christian.brauner@ubuntu.com, jbenc@redhat.com,
	pombredanne@nexb.com, linux-rdma@vger.kernel.org,
	netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, dev@openvswitch.org,
	linux-wireless@vger.kernel.org, selinux@tycho.nsa.gov,
	linux-security-module@vger.kernel.org
Subject: [PATCH net-next 3/5] security: Remove rtnl_lock() in selinux_xfrm_notify_policyload()
Date: Thu, 29 Mar 2018 19:20:56 +0300	[thread overview]
Message-ID: <152234045636.19153.4897050357891895124.stgit@localhost.localdomain> (raw)
In-Reply-To: <152234005959.19153.17907173734141707348.stgit@localhost.localdomain>

rt_genid_bump_all() consists of ipv4 and ipv6 part.
ipv4 part is incrementing of net::ipv4::rt_genid,
and I see many places, where it's read without rtnl_lock().

ipv6 part calls __fib6_clean_all(), and it's also
called without rtnl_lock() in other places.

So, rtnl_lock() here was used to iterate net_namespace_list only,
and we can remove it.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 security/selinux/include/xfrm.h |    2 --
 1 file changed, 2 deletions(-)

diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h
index 31d66431be1e..a0b465316292 100644
--- a/security/selinux/include/xfrm.h
+++ b/security/selinux/include/xfrm.h
@@ -47,12 +47,10 @@ static inline void selinux_xfrm_notify_policyload(void)
 {
 	struct net *net;
 
-	rtnl_lock();
 	down_read(&net_rwsem);
 	for_each_net(net)
 		rt_genid_bump_all(net);
 	up_read(&net_rwsem);
-	rtnl_unlock();
 }
 #else
 static inline int selinux_xfrm_enabled(void)

WARNING: multiple messages have this Message-ID (diff)
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: dledford@redhat.com, jgg@ziepe.ca, davem@davemloft.net,
	pablo@netfilter.org, kadlec@blackhole.kfki.hu, fw@strlen.de,
	pshelar@ovn.org, johannes@sipsolutions.net, paul@paul-moore.com,
	sds@tycho.nsa.gov, eparis@parisplace.org, jmorris@namei.org,
	serge@hallyn.com, leon@kernel.org, yuval.shaia@oracle.com,
	parav@mellanox.com, danielj@mellanox.com, ktkhai@virtuozzo.com,
	majd@mellanox.com, nicolas.dichtel@6wind.com,
	vyasevic@redhat.com, paulmck@linux.vnet.ibm.com,
	vyasevich@gmail.com, gregkh@linuxfoundation.org,
	daniel@iogearbox.net, jakub.kicinski@netronome.com,
	ast@kernel.org, brouer@redhat.com, linux@rasmusvillemoes.dk,
	john.fastabend@gmail.com, dsahern@gmail.com, jiri@mellanox.com,
	idosch@mellanox.com, vvs@virtuozzo.com, avagin@virtuozzo.com,
	roman.kapl@sysgo.com, lucien.xin@gmail.com,
Subject: [PATCH net-next 3/5] security: Remove rtnl_lock() in selinux_xfrm_notify_policyload()
Date: Thu, 29 Mar 2018 19:20:56 +0300	[thread overview]
Message-ID: <152234045636.19153.4897050357891895124.stgit@localhost.localdomain> (raw)
In-Reply-To: <152234005959.19153.17907173734141707348.stgit@localhost.localdomain>

rt_genid_bump_all() consists of ipv4 and ipv6 part.
ipv4 part is incrementing of net::ipv4::rt_genid,
and I see many places, where it's read without rtnl_lock().

ipv6 part calls __fib6_clean_all(), and it's also
called without rtnl_lock() in other places.

So, rtnl_lock() here was used to iterate net_namespace_list only,
and we can remove it.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 security/selinux/include/xfrm.h |    2 --
 1 file changed, 2 deletions(-)

diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h
index 31d66431be1e..a0b465316292 100644
--- a/security/selinux/include/xfrm.h
+++ b/security/selinux/include/xfrm.h
@@ -47,12 +47,10 @@ static inline void selinux_xfrm_notify_policyload(void)
 {
 	struct net *net;
 
-	rtnl_lock();
 	down_read(&net_rwsem);
 	for_each_net(net)
 		rt_genid_bump_all(net);
 	up_read(&net_rwsem);
-	rtnl_unlock();
 }
 #else
 static inline int selinux_xfrm_enabled(void)

WARNING: multiple messages have this Message-ID (diff)
From: ktkhai@virtuozzo.com (Kirill Tkhai)
To: linux-security-module@vger.kernel.org
Subject: [PATCH net-next 3/5] security: Remove rtnl_lock() in selinux_xfrm_notify_policyload()
Date: Thu, 29 Mar 2018 19:20:56 +0300	[thread overview]
Message-ID: <152234045636.19153.4897050357891895124.stgit@localhost.localdomain> (raw)
In-Reply-To: <152234005959.19153.17907173734141707348.stgit@localhost.localdomain>

rt_genid_bump_all() consists of ipv4 and ipv6 part.
ipv4 part is incrementing of net::ipv4::rt_genid,
and I see many places, where it's read without rtnl_lock().

ipv6 part calls __fib6_clean_all(), and it's also
called without rtnl_lock() in other places.

So, rtnl_lock() here was used to iterate net_namespace_list only,
and we can remove it.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 security/selinux/include/xfrm.h |    2 --
 1 file changed, 2 deletions(-)

diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h
index 31d66431be1e..a0b465316292 100644
--- a/security/selinux/include/xfrm.h
+++ b/security/selinux/include/xfrm.h
@@ -47,12 +47,10 @@ static inline void selinux_xfrm_notify_policyload(void)
 {
 	struct net *net;
 
-	rtnl_lock();
 	down_read(&net_rwsem);
 	for_each_net(net)
 		rt_genid_bump_all(net);
 	up_read(&net_rwsem);
-	rtnl_unlock();
 }
 #else
 static inline int selinux_xfrm_enabled(void)

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-03-29 16:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 16:20 [PATCH net-next 0/5] Introduce net_rwsem to protect net_namespace_list Kirill Tkhai
2018-03-29 16:20 ` Kirill Tkhai
2018-03-29 16:20 ` Kirill Tkhai
2018-03-29 16:20 ` [PATCH net-next 1/5] net: " Kirill Tkhai
2018-03-29 16:20   ` Kirill Tkhai
2018-03-29 16:20   ` Kirill Tkhai
2018-03-29 16:20 ` [PATCH net-next 2/5] net: Don't take rtnl_lock() in wireless_nlevent_flush() Kirill Tkhai
2018-03-29 16:20   ` Kirill Tkhai
2018-03-29 16:20 ` Kirill Tkhai
2018-03-29 16:20 ` Kirill Tkhai [this message]
2018-03-29 16:20   ` [PATCH net-next 3/5] security: Remove rtnl_lock() in selinux_xfrm_notify_policyload() Kirill Tkhai
2018-03-29 16:20   ` Kirill Tkhai
     [not found] ` <152234005959.19153.17907173734141707348.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2018-03-29 16:20   ` [PATCH net-next 1/5] net: Introduce net_rwsem to protect net_namespace_list Kirill Tkhai
2018-03-29 16:20   ` [PATCH net-next 2/5] net: Don't take rtnl_lock() in wireless_nlevent_flush() Kirill Tkhai
2018-03-29 16:20   ` [PATCH net-next 3/5] security: Remove rtnl_lock() in selinux_xfrm_notify_policyload() Kirill Tkhai
2018-03-29 16:21   ` [PATCH net-next 4/5] ovs: Remove rtnl_lock() from ovs_exit_net() Kirill Tkhai
2018-03-29 16:21   ` [PATCH net-next 5/5] net: Remove rtnl_lock() in nf_ct_iterate_destroy() Kirill Tkhai
2018-03-29 16:21 ` [PATCH net-next 4/5] ovs: Remove rtnl_lock() from ovs_exit_net() Kirill Tkhai
2018-03-29 16:21   ` Kirill Tkhai
2018-03-29 16:21   ` Kirill Tkhai
2018-03-29 16:21 ` [PATCH net-next 5/5] net: Remove rtnl_lock() in nf_ct_iterate_destroy() Kirill Tkhai
2018-03-29 16:21   ` Kirill Tkhai
2018-03-29 16:21 ` Kirill Tkhai
2018-03-29 17:48 ` [PATCH net-next 0/5] Introduce net_rwsem to protect net_namespace_list David Miller
2018-03-29 17:48   ` David Miller
2018-03-29 17:48   ` David Miller
2018-03-29 17:48   ` David Miller

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=152234045636.19153.4897050357891895124.stgit@localhost.localdomain \
    --to=ktkhai@virtuozzo.com \
    --cc=ast@kernel.org \
    --cc=avagin@virtuozzo.com \
    --cc=brouer@redhat.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=coreteam@netfilter.org \
    --cc=daniel@iogearbox.net \
    --cc=danielj@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=dledford@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=eparis@parisplace.org \
    --cc=fw@strlen.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=idosch@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=jbenc@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=jiri@mellanox.com \
    --cc=jmorris@namei.org \
    --cc=johannes@sipsolutions.net \
    --cc=john.fastabend@gmail.com \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lucien.xin@gmail.com \
    --cc=majd@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pablo@netfilter.org \
    --cc=parav@mellanox.com \
    --cc=paul@paul-moore.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pombredanne@nexb.com \
    --cc=pshelar@ovn.org \
    --cc=roman.kapl@sysgo.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=serge@hallyn.com \
    --cc=vvs@virtuozzo.com \
    --cc=vyasevic@redhat.com \
    --cc=vyasevich@gmail.com \
    --cc=yuval.shaia@oracle.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 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.