2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00
criu/images/fdinfo.proto
Bhavik Sachdev a1db7627b9 images: Add protobuf definition for pidfd
We only use the last pid from the list in NSpid entry (from
/proc/<pid>/fdinfo/<pidfd>) while restoring pidfds.
The last pid refers to the pid of the process in the most deeply nested
pid namespace. Since CRIU does not currently support nested pid
namespaces, this entry is the one we want.

After Linux 6.9, inode numbers can be used to compare pidfds. pidfds
referring to the same process will have the same inode numbers. We use
inode numbers to restore pidfds that point to dead processes.

Signed-off-by: Bhavik Sachdev <b.sachdev1904@gmail.com>
2024-10-26 22:18:22 -07:00

85 lines
1.9 KiB
Protocol Buffer

// SPDX-License-Identifier: MIT
syntax = "proto2";
import "regfile.proto";
import "sk-inet.proto";
import "ns.proto";
import "packet-sock.proto";
import "sk-netlink.proto";
import "eventfd.proto";
import "eventpoll.proto";
import "signalfd.proto";
import "tun.proto";
import "timerfd.proto";
import "fsnotify.proto";
import "ext-file.proto";
import "sk-unix.proto";
import "fifo.proto";
import "pipe.proto";
import "pidfd.proto";
import "tty.proto";
import "memfd.proto";
import "bpfmap-file.proto";
enum fd_types {
UND = 0;
REG = 1;
PIPE = 2;
FIFO = 3;
INETSK = 4;
UNIXSK = 5;
EVENTFD = 6;
EVENTPOLL = 7;
INOTIFY = 8;
SIGNALFD = 9;
PACKETSK = 10;
TTY = 11;
FANOTIFY = 12;
NETLINKSK = 13;
NS = 14;
TUNF = 15;
EXT = 16;
TIMERFD = 17;
MEMFD = 18;
BPFMAP = 19;
PIDFD = 20;
/* Any number above the real used. Not stored to image */
CTL_TTY = 65534;
AUTOFS_PIPE = 65535;
}
message fdinfo_entry {
required uint32 id = 1;
required uint32 flags = 2;
required fd_types type = 3;
required uint32 fd = 4;
optional string xattr_security_selinux = 5;
}
message file_entry {
required fd_types type = 1;
required uint32 id = 2;
optional reg_file_entry reg = 3;
optional inet_sk_entry isk = 4;
optional ns_file_entry nsf = 5;
optional packet_sock_entry psk = 6;
optional netlink_sk_entry nlsk = 7;
optional eventfd_file_entry efd = 8;
optional eventpoll_file_entry epfd = 9;
optional signalfd_entry sgfd = 10;
optional tunfile_entry tunf = 11;
optional timerfd_entry tfd = 12;
optional inotify_file_entry ify = 13;
optional fanotify_file_entry ffy = 14;
optional ext_file_entry ext = 15;
optional unix_sk_entry usk = 16;
optional fifo_entry fifo = 17;
optional pipe_entry pipe = 18;
optional tty_file_entry tty = 19;
optional memfd_file_entry memfd = 20;
optional bpfmap_file_entry bpf = 21;
optional pidfd_entry pidfd = 22;
}