criu/images
Mahadasyam, Shashank (SGC) 6c25e56a57 vma: introduce --allow-uprobes option
This commit teaches criu to deal with processes which have a "[uprobes]" vma.

This vma is mapped by the kernel when execution hits a uprobe location. This
is done so as to execute the uprobe'd instruciton out-of-line in the special
vma. The uprobe'd location is replaced by a software breakpoint instruction,
which is int3 on x86. When execution reaches that location, control is
transferred over to the kernel, which then executes whatever handler code
it has to, for the uprobe, and then executed the replaced instruction out-of-line
in the special vma. For more details, refer to this commit:
d4b3b6384f

Reason for adding a new option
------------------------------

A new option is added instead of making the uprobes vma handling transparent
to the user, so that when a dump is attempted on a process tree in which a
process has the uprobes vma, criu will error, asking the user to use this option.
This gives the user a chance to check what uprobes are attached to the processes
being dumped, and try to ensure that those uprobes are active on restore as well.

Again, the same reason for requiring this option on restore as well. Because
if a process is dumped with an active uprobe, and on restore if the uprobe
is not active, then if execution reaches the uprobe location, then the process
will be sent a SIGTRAP, whose default behaviour will terminate and core dump
the process. This is because the code pages are dumped with the software
breakpoint instruction replacement at the uprobe'd locations. On restore, if
execution reaches these locations and the kernel sees no associated active
uprobes, then it'll send a SIGTRAP.

So, using this option is on dump and restore is an implicit guarantee on the
user's behalf that they'll take care of the active uprobes and that any future
SIGTRAPs because of this are not on us! :)

Handling uprobes vma on dump
----------------------------

We don't need to store any information about the uprobes vma because it's
completely handled by the kernel, transparent to userspace. So, when a uprobes
vma is detected, we check if the --allow-uprobes option was specified or not.
If so, then the allow_uprobes boolean in the inventory image is set (this is
used on restore). The uprobes vma is skipped from being added to the vma list.

Handling uprobes vma on restore
-------------------------------

If allow_uprobes is set in the inventory image, then check if --allow-uprobes
is specified or not. Restoring the vma is not required.

Fixes: checkpoint-restore#1961
Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
2025-10-06 21:31:49 -07:00
..
google/protobuf Keep images/google/protobuf directory 2025-07-24 13:06:37 -07:00
apparmor.proto lsm: support checkpoint/restore of stacked apparmor profiles 2021-09-03 10:31:00 -07:00
autofs.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
binfmt-misc.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
bpfmap-data.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
bpfmap-file.proto bpfmap: handle new field in fdinfo 2022-04-28 17:53:52 -07:00
cgroup.proto cgroup-v2: make new field is_threaded optional 2023-04-15 21:17:21 -07:00
core-aarch64.proto arm64: C/R PAC keys 2025-03-15 11:59:19 +00:00
core-arm.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
core-loongarch64.proto images: add loongarch64 core image 2023-10-22 13:29:25 -07:00
core-mips.proto Remove execute bit from source file 2023-04-15 21:17:21 -07:00
core-ppc64.proto Fix some codespell warnings 2022-04-28 17:53:52 -07:00
core-riscv64.proto images: add riscv64 core image 2024-10-26 22:18:22 -07:00
core-s390.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
core-x86.proto compel: shstk: save CET state when CPU supports it 2024-09-11 16:02:11 -07:00
core.proto images: add riscv64 core image 2024-10-26 22:18:22 -07:00
cpuinfo.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
creds.proto cr: Task CapAmb support 2025-01-09 21:28:17 -08:00
eventfd.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
eventpoll.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
ext-file.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
fdinfo.proto images: Add protobuf definition for pidfd 2024-10-26 22:18:22 -07:00
fh.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
fifo.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
file-lock.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
fown.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
fs.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
fsnotify.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
ghost-file.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
img-streamer.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
inventory.proto vma: introduce --allow-uprobes option 2025-10-06 21:31:49 -07:00
ipc-desc.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
ipc-msg.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
ipc-sem.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
ipc-shm.proto ipc: Add support for checkpoint/restore hugetlb System V shared memory 2022-04-28 17:53:52 -07:00
ipc-var.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
LICENSE images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
macvlan.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
Makefile images/Makefile: use msg-gen 2025-07-24 13:06:37 -07:00
memfd.proto memfd: dump and restore permissions. 2023-10-22 13:29:25 -07:00
mm.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
mnt.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
netdev.proto net/sysctl: c/r ipv4/ping_group_range value 2025-02-03 12:35:58 +08:00
ns.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
opts.proto Fix some codespell warnings 2022-04-28 17:53:52 -07:00
packet-sock.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
pagemap.proto pagemap: change PagemapEntry.nr_pages to uint64 to support huge mappings 2025-09-23 11:05:14 +01:00
pidfd.proto images: Add protobuf definition for pidfd 2024-10-26 22:18:22 -07:00
pidns.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
pipe-data.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
pipe.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
pstree.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
regfile.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
remap-file-path.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
rlimit.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
rpc.proto rpc: Support setting images_dir by path. 2023-10-22 13:29:25 -07:00
rseq.proto rseq: handle rseq/rseq_cs flags properly 2022-04-28 17:53:52 -07:00
sa.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
seccomp.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
siginfo.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
signalfd.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
sit.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
sk-inet.proto sk-tcp: Move TCP socket options from TcpStreamEntry to TcpOptsEntry 2024-09-11 16:02:11 -07:00
sk-netlink.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
sk-opts.proto sk-tcp: Move TCP socket options from SkOptsEntry to TcpOptsEntry 2024-09-11 16:02:11 -07:00
sk-packet.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
sk-unix.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
stats.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
sysctl.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
tcp-stream.proto sk-tcp: Move TCP socket options from SkOptsEntry to TcpOptsEntry 2024-09-11 16:02:11 -07:00
time.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
timens.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
timer.proto criu: dump and restore notify_thread_id of posix timer 2021-09-03 10:31:00 -07:00
timerfd.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
tty.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
tun.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
userns.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
utsns.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00
vma.proto images: re-license as Expat license (so-called MIT) 2021-09-03 10:31:00 -07:00