netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/1] rtnetlink: request RTM_GETLINK by pid or fd
@ 2018-01-18 20:21 Christian Brauner
  2018-01-18 20:21 ` [PATCH net-next 1/1] " Christian Brauner
  0 siblings, 1 reply; 23+ messages in thread
From: Christian Brauner @ 2018-01-18 20:21 UTC (permalink / raw)
  To: davem, dsahern, fw, daniel, lucien.xin, mschiffer, jakub.kicinski,
	vyasevich, jbenc, netdev, linux-kernel
  Cc: Christian Brauner

Hey everyone,

This makes it possible to identify the target network namespace of a
RTM_GETLINK message by pid or fd.
Often userspace tools that make heavy use of network namespaces need a simple
and cheap way of querying network devices and network device properties. This
becomes even more crucial when the network namespaces in question are
transient. In such scenarios setting a netns id property is not really wanted
and it is preferable to avoid the hit of (possibly multiple) setns() syscalls
(e.g. attaching to the target network namespace and back to the original
network namespace.). This commit lets userspace set the IFLA_NET_NS_{FD,PID}
property to identify a target network namespace where the device in question is
to be queried.
I couldn't find any obvious reason why this shouldn't be allowed but I haven't
done a deep dive into the possible security implications. So if I missed a very
obvious point why this wasn't possible so far, I'm sorry.

Christian

Christian Brauner (1):
  rtnetlink: request RTM_GETLINK by pid or fd

 net/core/rtnetlink.c | 63 +++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 50 insertions(+), 13 deletions(-)

-- 
2.14.1

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

end of thread, other threads:[~2018-01-24 11:53 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-18 20:21 [PATCH net-next 0/1] rtnetlink: request RTM_GETLINK by pid or fd Christian Brauner
2018-01-18 20:21 ` [PATCH net-next 1/1] " Christian Brauner
2018-01-18 20:29   ` Jiri Benc
2018-01-18 20:55     ` Christian Brauner
2018-01-22 21:00       ` Jiri Benc
2018-01-22 21:23         ` Christian Brauner
2018-01-22 22:06           ` Jiri Benc
2018-01-22 22:25             ` Christian Brauner
2018-01-23  9:30               ` Jiri Benc
2018-01-23 10:26                 ` Wolfgang Bumiller
2018-01-23 10:42                   ` Jiri Benc
     [not found]                     ` <20180123114218.vsm5nu2jajrqjvko@gmail.com>
2018-01-23 12:22                       ` Jiri Benc
2018-01-23 16:55                         ` Nicolas Dichtel
2018-01-23 18:05                           ` Christian Brauner
2018-01-24 11:32                         ` [PATCH net-next 0/3] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK Christian Brauner
2018-01-24 11:32                           ` [PATCH net-next 1/3] rtnetlink: enable IFLA_IF_NETNSID in do_setlink() Christian Brauner
2018-01-24 11:52                         ` [PATCH net-next 2/3] rtnetlink: enable IFLA_IF_NETNSID for RTM_SETLINK Christian Brauner
2018-01-24 11:53                         ` [PATCH net-next 3/3] rtnetlink: enable IFLA_IF_NETNSID for RTM_DELLINK Christian Brauner
2018-01-23 16:50                   ` [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd Nicolas Dichtel
2018-01-23 16:37             ` Nicolas Dichtel
2018-01-23 17:08               ` Jiri Benc
2018-01-24 10:53                 ` Nicolas Dichtel
2018-01-24 11:03                   ` Jiri Benc

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