[CRIU] [PATCH 0/9] unix: restore sockets in proper mount namespaces

Andrei Vagin avagin at virtuozzo.com
Fri Mar 16 20:24:21 MSK 2018


In 4.10 kernel, we added the SIOCUNIXFILE ioctl for unix sockets.  This
ioctl opens a file to which a socket is bound and returns a file
descriptor.

This new ioctl allows us to get mnt_id by reading fdinfo, and mnt_id
is enough to find a proper mount point and a mount namespace.

The logic of this series is straight forward. On dump, we save mnt_id for
sockets, on restore we find a mount namespace by mnt_id and restore this
socket in its mount namespace.

Andrei Vagin (9):
  zdtm: check unix sockets in two mount namespaces
  unix: handle sockets with USK_CALLBACK as external sockets
  kerndat: check the SIOCUNIXFILE ioctl for unix sockets
  unix: resolve a socket file when a socket descriptor is available
  unix: restore sockets on correct mount points
  unix: split bind_unix_sk() for readability
  unit: don't check ui->ue->name.len twice in bind_unix_sk()
  unix: fix an error code in bind_unix_sk()
  unix: split dump_external_sockets() for readability

 criu/cr-check.c                     |   9 +
 criu/include/kerndat.h              |   1 +
 criu/include/sockets.h              |   1 +
 criu/kerndat.c                      |   2 +
 criu/sk-unix.c                      | 535 ++++++++++++++++++++++--------------
 images/sk-unix.proto                |   1 +
 test/zdtm/static/Makefile           |   1 +
 test/zdtm/static/sk-unix-mntns.c    | 159 +++++++++++
 test/zdtm/static/sk-unix-mntns.desc |   5 +
 9 files changed, 510 insertions(+), 204 deletions(-)
 create mode 100644 test/zdtm/static/sk-unix-mntns.c
 create mode 100644 test/zdtm/static/sk-unix-mntns.desc

-- 
2.13.6



More information about the CRIU mailing list