All of lore.kernel.org
 help / color / mirror / Atom feed
* netlink versus pid namespaces
@ 2010-10-15 14:23 Andi Kleen
  2010-10-15 15:19 ` Alexey Kuznetsov
  2010-10-15 15:19 ` Alexey Kuznetsov
  0 siblings, 2 replies; 6+ messages in thread
From: Andi Kleen @ 2010-10-15 14:23 UTC (permalink / raw)
  To: netdev, xemul, kuznet, virtualization

Hi,

I have been trying to figure out how pid namespaces interact
with netlink.

netlink uses pids (or really tids I hope?) to address sockets
associated with processes.

The netlink code passes around pids without caring much about 
the pid namespace.  It does pass around some information about the 
network namespace, but that doesn't help here because the pid
namespace is not necessarily related to the net namespace.

When the netlink consumer runs in kernel (like rtnetlink) and
happens to run in the same process context while receiving
and processing the data it should do the right thing because
it has the same pid namespace.

If it runs in some other process that is not guaranteed and
it may actually send the reply back to the wrong pid.

When a process receives netlink in user space and it isn't
in the same pid space as the sender it is unlikely that
the reply gets back.

Anything I'm missing here? 

Does netlink need to be extended? 
Or perhaps forbid passing netlink between name spaces?

Thanks,
-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* netlink versus pid namespaces
@ 2010-10-15 14:23 Andi Kleen
  0 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2010-10-15 14:23 UTC (permalink / raw)
  To: netdev, xemul, kuznet, virtualization

Hi,

I have been trying to figure out how pid namespaces interact
with netlink.

netlink uses pids (or really tids I hope?) to address sockets
associated with processes.

The netlink code passes around pids without caring much about 
the pid namespace.  It does pass around some information about the 
network namespace, but that doesn't help here because the pid
namespace is not necessarily related to the net namespace.

When the netlink consumer runs in kernel (like rtnetlink) and
happens to run in the same process context while receiving
and processing the data it should do the right thing because
it has the same pid namespace.

If it runs in some other process that is not guaranteed and
it may actually send the reply back to the wrong pid.

When a process receives netlink in user space and it isn't
in the same pid space as the sender it is unlikely that
the reply gets back.

Anything I'm missing here? 

Does netlink need to be extended? 
Or perhaps forbid passing netlink between name spaces?

Thanks,
-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

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

end of thread, other threads:[~2010-10-15 15:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 14:23 netlink versus pid namespaces Andi Kleen
2010-10-15 15:19 ` Alexey Kuznetsov
2010-10-15 15:23   ` Andi Kleen
2010-10-15 15:23   ` Andi Kleen
2010-10-15 15:19 ` Alexey Kuznetsov
  -- strict thread matches above, loose matches on Subject: below --
2010-10-15 14:23 Andi Kleen

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.