linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] RFC: SO_PEERCRED for AF_VSOCK
@ 2021-10-21 12:37 Marc-André Lureau
  2021-10-21 12:37 ` [PATCH 01/10] sock: move sock_init_peercred() from af_unix Marc-André Lureau
                   ` (10 more replies)
  0 siblings, 11 replies; 18+ messages in thread
From: Marc-André Lureau @ 2021-10-21 12:37 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, sgarzare, davem, kuba, Marc-André Lureau

Hi,

This RFC aims to implement some support for SO_PEERCRED with AF_VSOCK,
so vsock servers & clients can lookup the basic peer credentials.
(further support for SO_PEERSEC could also be useful)

This is pretty straightforward for loopback transport, where both ends
are on the same host.

For vhost transport, the host will set the peer credentials associated with
the process who called VHOST_SET_OWNER (ex QEMU).

For virtio transport, the credentials are cleared upon connect, as
providing foreign credentials wouldn't make much sense.

I haven't looked at other transports. What do you think of this approach?

Note: I think it would be a better to set the peer credentials when we
actually can provide them, rather than at creation time, but I haven't
found a way yet. Help welcome!

Marc-André Lureau (10):
  sock: move sock_init_peercred() from af_unix
  sock: move sock_copy_peercred() from af_unix
  vsock: owner field is specific to VMCI
  sock: add sock_swap_peercred
  virtio/vsock: add copy_peercred() to virtio_transport
  vsock: set socket peercred
  vsock/loopback: implement copy_peercred()
  vhost/vsock: save owner pid & creds
  vhost/vsock: implement copy_peercred
  vsock/virtio: clear peer creds on connect

 drivers/vhost/vsock.c                   | 46 +++++++++++++++++
 include/linux/virtio_vsock.h            |  2 +
 include/net/af_vsock.h                  |  2 +
 include/net/sock.h                      |  9 ++++
 net/core/sock.c                         | 66 +++++++++++++++++++++++++
 net/unix/af_unix.c                      | 50 ++-----------------
 net/vmw_vsock/af_vsock.c                |  8 +++
 net/vmw_vsock/virtio_transport.c        | 22 ++++++++-
 net/vmw_vsock/virtio_transport_common.c |  9 ++++
 net/vmw_vsock/vsock_loopback.c          |  7 +++
 10 files changed, 175 insertions(+), 46 deletions(-)


base-commit: e0bfcf9c77d9b2c11d2767f0c747f7721ae0cc51
-- 
2.33.0.721.g106298f7f9


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

end of thread, other threads:[~2021-11-05  8:21 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 12:37 [PATCH 00/10] RFC: SO_PEERCRED for AF_VSOCK Marc-André Lureau
2021-10-21 12:37 ` [PATCH 01/10] sock: move sock_init_peercred() from af_unix Marc-André Lureau
2021-10-21 12:37 ` [PATCH 02/10] sock: move sock_copy_peercred() " Marc-André Lureau
2021-10-21 12:37 ` [PATCH 03/10] vsock: owner field is specific to VMCI Marc-André Lureau
2021-10-26 11:16   ` Stefano Garzarella
2021-10-27  8:13     ` Jorgen Hansen
2021-11-05  8:21       ` Marc-André Lureau
2021-10-21 12:37 ` [PATCH 04/10] sock: add sock_swap_peercred Marc-André Lureau
2021-10-21 12:37 ` [PATCH 05/10] virtio/vsock: add copy_peercred() to virtio_transport Marc-André Lureau
2021-10-26 11:17   ` Stefano Garzarella
2021-10-21 12:37 ` [PATCH 06/10] vsock: set socket peercred Marc-André Lureau
2021-10-26 11:18   ` Stefano Garzarella
2021-10-21 12:37 ` [PATCH 07/10] vsock/loopback: implement copy_peercred() Marc-André Lureau
2021-10-26 11:18   ` Stefano Garzarella
2021-10-21 12:37 ` [PATCH 08/10] vhost/vsock: save owner pid & creds Marc-André Lureau
2021-10-21 12:37 ` [PATCH 09/10] vhost/vsock: implement copy_peercred Marc-André Lureau
2021-10-21 12:37 ` [PATCH 10/10] vsock/virtio: clear peer creds on connect Marc-André Lureau
2021-10-21 13:34 ` [PATCH 00/10] RFC: SO_PEERCRED for AF_VSOCK Stefano Garzarella

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