criu/images/pipe.proto
Ahmed Elaidy fa79188901 pipes: restore pipe ownership to fix /proc/self/fd access
When CRIU runs as root and restores a pipe, the pipe inode is created
with root ownership. If the restored process runs as a non-root user
and tries to reopen the pipe via /proc/self/fd/<n>, the open() fails
with EACCES because the pipe inode is owned by root.

Fix this by saving the pipe's uid/gid during dump (from stat) and
restoring ownership with fchown() after creating the pipe. This
matches how memfds and TTYs already handle ownership restoration.

Fixes: #2984

Signed-off-by: Ahmed Elaidy <elaidya225@gmail.com>
2026-03-25 21:09:15 -07:00

15 lines
316 B
Protocol Buffer

// SPDX-License-Identifier: MIT
syntax = "proto2";
import "opts.proto";
import "fown.proto";
message pipe_entry {
required uint32 id = 1;
required uint32 pipe_id = 2;
required uint32 flags = 3 [(criu).hex = true];
required fown_entry fown = 4;
optional uint32 uid = 5;
optional uint32 gid = 6;
}