<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Amikhalitsyn</id>
	<title>CRIU - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Amikhalitsyn"/>
	<link rel="alternate" type="text/html" href="https://criu.org/Special:Contributions/Amikhalitsyn"/>
	<updated>2026-05-13T13:03:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5874</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5874"/>
		<updated>2026-03-02T13:59:36Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */ COW pages dump optimization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contact ==&lt;br /&gt;
&lt;br /&gt;
First, make sure to go through the [[GSoC Students Recommendations]]. Once you build CRIU locally and C/R a simple process successfully, please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@lists.linux.dev mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes Operator for Automated Checkpointing ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Extend the Checkpoint/Restore Operator with support for automated policy-based checkpointing.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/checkpoint-restore/checkpoint-restore-operator Checkpoint/Restore Operator] for Kubernetes currently supports only policies and parameters that limit the number of checkpoints. This project aims to extend the current support with automated policy-based checkpointing, allowing users to define triggers for checkpoint creation, such as time-based schedules, resource thresholds (CPU, memory, I/O usage), Kubernetes events (node drain, pod eviction, preemption), and application-level signals or annotations.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Viktória Spišaková &amp;lt;spisakova@ics.muni.cz&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Forensic Checkpointing Framework for Kubernetes ===&lt;br /&gt;
&lt;br /&gt;
Kubernetes provides a highly dynamic and ephemeral environment where workloads can start and disappear very quickly and are continuously being rescheduled across different nodes in the cluster.&lt;br /&gt;
One of the key challenges with forensic investigations in Kubernetes is capturing and preserving the evidence during security incidents. This project aims to address this problem by developing a framework for efficiently capturing and preserving the state of all running applications in a container at a specific point in time, along with the associated container configurations and metadata. These artifacts would allow investigators to accurately reconstruct the events, create a timeline, and analyze security incidents without impacting the running cluster. This is an important step towards enabling forensic readiness for Kubernetes, where cluster administrators proactively ensure the environments are prepared to collect and preserve evidence before a security incident occurs.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpointctl&lt;br /&gt;
* [https://fosdem.org/2026/events/attachments/F9RANH-forensic-snapshots-in-kubernetes/slides/267371/fosdem_2_4dh73ni.pdf Investigating Security Incidents with Forensic Snapshots in Kubernetes]&lt;br /&gt;
* [https://www.cncf.io/reports/cloud-native-security-whitepaper/ Cloud Native Security Whitepaper]&lt;br /&gt;
* [https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF Kubernetes Hardening Guide]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Lorena Goldoni &amp;lt;lory.goldoni@gmail.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling Checkpoint/Restore of Rootless Containers ===&lt;br /&gt;
&lt;br /&gt;
[https://rootlesscontaine.rs/ Rootless containers] are containers that can be created, run, and managed by unprivileged users. Container engines such as Podman natively support running containers in a rootless mode to improve security and usability. While checkpoint/restore functionality is already available for rootful containers and unprivileged checkpointing is possible with the &amp;lt;code&amp;gt;CAP_CHECKPOINT_RESTORE&amp;lt;/code&amp;gt; capability, container engines do not yet support native checkpointing of containers running in rootless mode. This project aims to explore and address the remaining challenges required to enable unprivileged checkpoint/restore for rootless containers.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/pull/1930&lt;br /&gt;
* https://github.com/torvalds/linux/commit/124ea650d3072b005457faed69909221c2905a1f&lt;br /&gt;
* https://src.fedoraproject.org/rpms/criu/pull-request/10#request_diff&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for SCM_CREDENTIALS / SCM_PIDFD and friends ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support for SCM_CREDENTIALS / SCM_PIDFD&lt;br /&gt;
&lt;br /&gt;
SCM_CREDENTIALS and SCM_PIDFD are types of SCM (Socket-level Control Messages). They play a crucial role&lt;br /&gt;
in systemd and many other user space applications. This project is about adding support for these&lt;br /&gt;
SCMs to be properly saved and restored back with CRIU. There is an existing code in OpenVZ CRIU fork,&lt;br /&gt;
see [1] and [2]. Goal would be first of all to properly port this code, cover with extensive tests and&lt;br /&gt;
ensure that SCM_PIDFD / SO_PEERPIDFD are handled correctly. Also we expect to cover things like&lt;br /&gt;
SO_PASSRIGHTS and SO_PASSPIDFD.&lt;br /&gt;
&lt;br /&gt;
There is some extra source of complexity here pidfds can be &amp;quot;stale&amp;quot; (see PIDFD_STALE in Linux kernel)&lt;br /&gt;
and we need to ensure that we properly cover those cases.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [1] openvz-criu https://bitbucket.org/openvz/criu.ovz/history-node/918653a0a343194385592d7b50b5bd7a8fbe1cc1/criu/sk-unix.c?at=hci-dev&lt;br /&gt;
* [2] openvz-criu https://bitbucket.org/openvz/criu.ovz/history-node/918653a0a343194385592d7b50b5bd7a8fbe1cc1/criu/sk-queue.c?at=hci-dev&lt;br /&gt;
* [3] Linux kernel https://github.com/torvalds/linux/commit/5e2ff6704a275be009be8979af17c52361b79b89&lt;br /&gt;
* [4] Linux kernel https://github.com/torvalds/linux/commit/c679d17d3f2d895b34e660673141ad250889831f&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate / advanced&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Mentors: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Integrate with Live Update Orchestrator (LUO) ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Integrate with Live Update Orchestrator (LUO)&lt;br /&gt;
&lt;br /&gt;
Live Update Orchestrator (LUO) is a framework for Linux kernel&lt;br /&gt;
live updates (via kexec). Idea behind it is to provide kernel&lt;br /&gt;
and user space API to save specific system resources across&lt;br /&gt;
kexec reboot.&lt;br /&gt;
&lt;br /&gt;
This research project explores how CRIU can be integrated with LUO.&lt;br /&gt;
For example, if a user is running memcached on a node, the current&lt;br /&gt;
approach would require a full CRIU dump, then saving the entire&lt;br /&gt;
process memory to disk, then followed by restoring it after the&lt;br /&gt;
kernel live update.&lt;br /&gt;
&lt;br /&gt;
Instead, CRIU could be extended to leverage the LUO API. When instructed,&lt;br /&gt;
it could preserve selected memory regions directly across the kexec reboot,&lt;br /&gt;
avoiding a full disk dump and significantly accelerating the restore process&lt;br /&gt;
after the kernel update.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [1] LUO kernel documentation https://docs.kernel.org/core-api/liveupdate.html&lt;br /&gt;
* [2] LUO memfd doc https://docs.kernel.org/mm/memfd_preservation.html&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate / advanced&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optimize COW memory dumping ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Optimize COW memory dumping&lt;br /&gt;
&lt;br /&gt;
The Linux kernel memory management subsystem is highly optimized not only for performance, but also to minimize unnecessary memory consumption. A key example of this is how the kernel handles private VMAs when user space invokes the fork() system call.&lt;br /&gt;
&lt;br /&gt;
Rather than duplicating the entire VMA tree along with all memory contents, the kernel creates optimized copies of inherited VMAs using the Copy-on-Write (COW) mechanism. When a process writes to a page within a COW-ed VMA, a write page fault occurs, and the kernel creates a private copy of that page before applying the modification. However, if the page is only read, no copying is performed.&lt;br /&gt;
&lt;br /&gt;
This approach significantly improves fork() performance and can dramatically reduce memory usage in many workloads.&lt;br /&gt;
&lt;br /&gt;
In CRIU, when dumping VMAs and their associated memory pages, this COW optimization is not currently taken into account during the dump phase. As a result, for COW-backed VMAs, CRIU may generate multiple copies of identical memory pages in the dump image.&lt;br /&gt;
&lt;br /&gt;
During restore, however, CRIU explicitly handles this situation (see [1] and [2]) and attempts to reconstruct COW relationships inside the kernel. This step is critical: without it, a checkpoint/restore (C/R) cycle could lead to a substantial increase in memory consumption for the same process tree. For example, a workload that originally consumed 500 MiB could expand to 800 MiB after restore, which is clearly unacceptable.&lt;br /&gt;
&lt;br /&gt;
This project aims to improve the dumping algorithm so that it avoids producing multiple unnecessary copies of identical pages belonging to COW-ed VMAs.&lt;br /&gt;
&lt;br /&gt;
The project requires some understanding of Linux memory management internals and CRIU’s architecture. We strongly encourage GSoC contributors to study references [1] and [2] and experiment with the relevant code paths before applying. We are happy to answer questions and provide guidance along the way.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [1] preparing COW VMAs https://github.com/checkpoint-restore/criu/blob/c180188db036f8ea4c08bfee28cbcdbdd52cdfc3/criu/mem.c#L878&lt;br /&gt;
* [2] private vma content restore cow case https://github.com/checkpoint-restore/criu/blob/c180188db036f8ea4c08bfee28cbcdbdd52cdfc3/criu/mem.c#L1219&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate / advanced&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
&lt;br /&gt;
We already had a couple (3) of tries for this problem:&lt;br /&gt;
&lt;br /&gt;
* UDP_REPAIR approach didn't succeed: https://lore.kernel.org/netdev/721a2e32-c930-ad6b-5055-631b502ed11b@gmail.com/, https://lore.kernel.org/netdev/?q=udp_repair&lt;br /&gt;
* eBPF (CRIB) approach, socket queue iterator was not merged: https://lore.kernel.org/netdev/AM6PR03MB5848EDA002E3D7EACA7C6BDA99A52@AM6PR03MB5848.eurprd03.prod.outlook.com/, and we have general objections to CRIB approach https://lore.kernel.org/bpf/CAHk-=wjLWFa3i6+Tab67gnNumTYipj_HuheXr2RCq4zn0tCTzA@mail.gmail.com/&lt;br /&gt;
&lt;br /&gt;
We still have one idea we didn't try, as UDP allows packets to be lost on the way on restore we can somehow mark the socket to drop all data before UNCORK. This way we don't really need to restore contents of UDP CORK-ed sockets send queue.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5873</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5873"/>
		<updated>2026-03-02T13:20:03Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */ Add LUO integration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contact ==&lt;br /&gt;
&lt;br /&gt;
First, make sure to go through the [[GSoC Students Recommendations]]. Once you build CRIU locally and C/R a simple process successfully, please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@lists.linux.dev mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes Operator for Automated Checkpointing ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Extend the Checkpoint/Restore Operator with support for automated policy-based checkpointing.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/checkpoint-restore/checkpoint-restore-operator Checkpoint/Restore Operator] for Kubernetes currently supports only policies and parameters that limit the number of checkpoints. This project aims to extend the current support with automated policy-based checkpointing, allowing users to define triggers for checkpoint creation, such as time-based schedules, resource thresholds (CPU, memory, I/O usage), Kubernetes events (node drain, pod eviction, preemption), and application-level signals or annotations.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Viktória Spišaková &amp;lt;spisakova@ics.muni.cz&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Forensic Checkpointing Framework for Kubernetes ===&lt;br /&gt;
&lt;br /&gt;
Kubernetes provides a highly dynamic and ephemeral environment where workloads can start and disappear very quickly and are continuously being rescheduled across different nodes in the cluster.&lt;br /&gt;
One of the key challenges with forensic investigations in Kubernetes is capturing and preserving the evidence during security incidents. This project aims to address this problem by developing a framework for efficiently capturing and preserving the state of all running applications in a container at a specific point in time, along with the associated container configurations and metadata. These artifacts would allow investigators to accurately reconstruct the events, create a timeline, and analyze security incidents without impacting the running cluster. This is an important step towards enabling forensic readiness for Kubernetes, where cluster administrators proactively ensure the environments are prepared to collect and preserve evidence before a security incident occurs.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpointctl&lt;br /&gt;
* [https://fosdem.org/2026/events/attachments/F9RANH-forensic-snapshots-in-kubernetes/slides/267371/fosdem_2_4dh73ni.pdf Investigating Security Incidents with Forensic Snapshots in Kubernetes]&lt;br /&gt;
* [https://www.cncf.io/reports/cloud-native-security-whitepaper/ Cloud Native Security Whitepaper]&lt;br /&gt;
* [https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF Kubernetes Hardening Guide]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Lorena Goldoni &amp;lt;lory.goldoni@gmail.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling Checkpoint/Restore of Rootless Containers ===&lt;br /&gt;
&lt;br /&gt;
[https://rootlesscontaine.rs/ Rootless containers] are containers that can be created, run, and managed by unprivileged users. Container engines such as Podman natively support running containers in a rootless mode to improve security and usability. While checkpoint/restore functionality is already available for rootful containers and unprivileged checkpointing is possible with the &amp;lt;code&amp;gt;CAP_CHECKPOINT_RESTORE&amp;lt;/code&amp;gt; capability, container engines do not yet support native checkpointing of containers running in rootless mode. This project aims to explore and address the remaining challenges required to enable unprivileged checkpoint/restore for rootless containers.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/pull/1930&lt;br /&gt;
* https://github.com/torvalds/linux/commit/124ea650d3072b005457faed69909221c2905a1f&lt;br /&gt;
* https://src.fedoraproject.org/rpms/criu/pull-request/10#request_diff&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for SCM_CREDENTIALS / SCM_PIDFD and friends ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support for SCM_CREDENTIALS / SCM_PIDFD&lt;br /&gt;
&lt;br /&gt;
SCM_CREDENTIALS and SCM_PIDFD are types of SCM (Socket-level Control Messages). They play a crucial role&lt;br /&gt;
in systemd and many other user space applications. This project is about adding support for these&lt;br /&gt;
SCMs to be properly saved and restored back with CRIU. There is an existing code in OpenVZ CRIU fork,&lt;br /&gt;
see [1] and [2]. Goal would be first of all to properly port this code, cover with extensive tests and&lt;br /&gt;
ensure that SCM_PIDFD / SO_PEERPIDFD are handled correctly. Also we expect to cover things like&lt;br /&gt;
SO_PASSRIGHTS and SO_PASSPIDFD.&lt;br /&gt;
&lt;br /&gt;
There is some extra source of complexity here pidfds can be &amp;quot;stale&amp;quot; (see PIDFD_STALE in Linux kernel)&lt;br /&gt;
and we need to ensure that we properly cover those cases.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [1] openvz-criu https://bitbucket.org/openvz/criu.ovz/history-node/918653a0a343194385592d7b50b5bd7a8fbe1cc1/criu/sk-unix.c?at=hci-dev&lt;br /&gt;
* [2] openvz-criu https://bitbucket.org/openvz/criu.ovz/history-node/918653a0a343194385592d7b50b5bd7a8fbe1cc1/criu/sk-queue.c?at=hci-dev&lt;br /&gt;
* [3] Linux kernel https://github.com/torvalds/linux/commit/5e2ff6704a275be009be8979af17c52361b79b89&lt;br /&gt;
* [4] Linux kernel https://github.com/torvalds/linux/commit/c679d17d3f2d895b34e660673141ad250889831f&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate / advanced&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Mentors: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Integrate with Live Update Orchestrator (LUO) ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Integrate with Live Update Orchestrator (LUO)&lt;br /&gt;
&lt;br /&gt;
Live Update Orchestrator (LUO) is a framework for Linux kernel&lt;br /&gt;
live updates (via kexec). Idea behind it is to provide kernel&lt;br /&gt;
and user space API to save specific system resources across&lt;br /&gt;
kexec reboot.&lt;br /&gt;
&lt;br /&gt;
This research project explores how CRIU can be integrated with LUO.&lt;br /&gt;
For example, if a user is running memcached on a node, the current&lt;br /&gt;
approach would require a full CRIU dump, then saving the entire&lt;br /&gt;
process memory to disk, then followed by restoring it after the&lt;br /&gt;
kernel live update.&lt;br /&gt;
&lt;br /&gt;
Instead, CRIU could be extended to leverage the LUO API. When instructed,&lt;br /&gt;
it could preserve selected memory regions directly across the kexec reboot,&lt;br /&gt;
avoiding a full disk dump and significantly accelerating the restore process&lt;br /&gt;
after the kernel update.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [1] LUO kernel documentation https://docs.kernel.org/core-api/liveupdate.html&lt;br /&gt;
* [2] LUO memfd doc https://docs.kernel.org/mm/memfd_preservation.html&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate / advanced&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
&lt;br /&gt;
We already had a couple (3) of tries for this problem:&lt;br /&gt;
&lt;br /&gt;
* UDP_REPAIR approach didn't succeed: https://lore.kernel.org/netdev/721a2e32-c930-ad6b-5055-631b502ed11b@gmail.com/, https://lore.kernel.org/netdev/?q=udp_repair&lt;br /&gt;
* eBPF (CRIB) approach, socket queue iterator was not merged: https://lore.kernel.org/netdev/AM6PR03MB5848EDA002E3D7EACA7C6BDA99A52@AM6PR03MB5848.eurprd03.prod.outlook.com/, and we have general objections to CRIB approach https://lore.kernel.org/bpf/CAHk-=wjLWFa3i6+Tab67gnNumTYipj_HuheXr2RCq4zn0tCTzA@mail.gmail.com/&lt;br /&gt;
&lt;br /&gt;
We still have one idea we didn't try, as UDP allows packets to be lost on the way on restore we can somehow mark the socket to drop all data before UNCORK. This way we don't really need to restore contents of UDP CORK-ed sockets send queue.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5870</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5870"/>
		<updated>2026-02-09T22:17:09Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */ add SCM_CREDENTIALS / SCM_PIDFD project idea&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contact ==&lt;br /&gt;
&lt;br /&gt;
First, make sure to go through the [[GSoC Students Recommendations]]. Once you build CRIU locally and C/R a simple process successfully, please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@lists.linux.dev mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes Operator for Automated Checkpointing ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Extend the Checkpoint/Restore Operator with support for automated policy-based checkpointing.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/checkpoint-restore/checkpoint-restore-operator Checkpoint/Restore Operator] for Kubernetes currently supports only policies and parameters that limit the number of checkpoints. This project aims to extend the current support with automated policy-based checkpointing, allowing users to define triggers for checkpoint creation, such as time-based schedules, resource thresholds (CPU, memory, I/O usage), Kubernetes events (node drain, pod eviction, preemption), and application-level signals or annotations.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Viktória Spišaková &amp;lt;spisakova@ics.muni.cz&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Forensic Checkpointing Framework for Kubernetes ===&lt;br /&gt;
&lt;br /&gt;
Kubernetes provides a highly dynamic and ephemeral environment where workloads can start and disappear very quickly and are continuously being rescheduled across different nodes in the cluster.&lt;br /&gt;
One of the key challenges with forensic investigations in Kubernetes is capturing and preserving the evidence during security incidents. This project aims to address this problem by developing a framework for efficiently capturing and preserving the state of all running applications in a container at a specific point in time, along with the associated container configurations and metadata. These artifacts would allow investigators to accurately reconstruct the events, create a timeline, and analyze security incidents without impacting the running cluster. This is an important step towards enabling forensic readiness for Kubernetes, where cluster administrators proactively ensure the environments are prepared to collect and preserve evidence before a security incident occurs.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpointctl&lt;br /&gt;
* [https://fosdem.org/2026/events/attachments/F9RANH-forensic-snapshots-in-kubernetes/slides/266249/fosdem_2_4dh73ni.pdf Investigating Security Incidents with Forensic Snapshots in Kubernetes]&lt;br /&gt;
* [https://www.cncf.io/reports/cloud-native-security-whitepaper/ Cloud Native Security Whitepaper]&lt;br /&gt;
* [https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF Kubernetes Hardening Guide]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Lorena Goldoni &amp;lt;lory.goldoni@gmail.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling Checkpoint/Restore of Rootless Containers ===&lt;br /&gt;
&lt;br /&gt;
[https://rootlesscontaine.rs/ Rootless containers] are containers that can be created, run, and managed by unprivileged users. Container engines such as Podman natively support running containers in a rootless mode to improve security and usability. While checkpoint/restore functionality is already available for rootful containers and unprivileged checkpointing is possible with the &amp;lt;code&amp;gt;CAP_CHECKPOINT_RESTORE&amp;lt;/code&amp;gt; capability, container engines do not yet support native checkpointing of containers running in rootless mode. This project aims to explore and address the remaining challenges required to enable unprivileged checkpoint/restore for rootless containers.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/pull/1930&lt;br /&gt;
* https://github.com/torvalds/linux/commit/124ea650d3072b005457faed69909221c2905a1f&lt;br /&gt;
* https://src.fedoraproject.org/rpms/criu/pull-request/10#request_diff&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for memory compression ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support compression for page images&lt;br /&gt;
 &lt;br /&gt;
We would like to support memory page files compression&lt;br /&gt;
in CRIU using one of the fastest algorithms (it's matter&lt;br /&gt;
of discussion which one to choose!).&lt;br /&gt;
&lt;br /&gt;
This task does not require any Linux kernel modifications&lt;br /&gt;
and scope is limited to CRIU itself. At the same time it's&lt;br /&gt;
complex enough as we need to touch memory dump/restore codepath&lt;br /&gt;
in CRIU and also handle many corner cases like page-server and stuff.&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for SCM_CREDENTIALS / SCM_PIDFD and friends ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support for SCM_CREDENTIALS / SCM_PIDFD&lt;br /&gt;
&lt;br /&gt;
SCM_CREDENTIALS and SCM_PIDFD are types of SCM (Socket-level Control Messages). They play a crucial role&lt;br /&gt;
in systemd and many other user space applications. This project is about adding support for these&lt;br /&gt;
SCMs to be properly saved and restored back with CRIU. There is an existing code in OpenVZ CRIU fork,&lt;br /&gt;
see [1] and [2]. Goal would be first of all to properly port this code, cover with extensive tests and&lt;br /&gt;
ensure that SCM_PIDFD / SO_PEERPIDFD are handled correctly. Also we expect to cover things like&lt;br /&gt;
SO_PASSRIGHTS and SO_PASSPIDFD.&lt;br /&gt;
&lt;br /&gt;
There is some extra source of complexity here pidfds can be &amp;quot;stale&amp;quot; (see PIDFD_STALE in Linux kernel)&lt;br /&gt;
and we need to ensure that we properly cover those cases.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [1] openvz-criu https://bitbucket.org/openvz/criu.ovz/history-node/918653a0a343194385592d7b50b5bd7a8fbe1cc1/criu/sk-unix.c?at=hci-dev&lt;br /&gt;
* [2] openvz-criu https://bitbucket.org/openvz/criu.ovz/history-node/918653a0a343194385592d7b50b5bd7a8fbe1cc1/criu/sk-queue.c?at=hci-dev&lt;br /&gt;
* [3] Linux kernel https://github.com/torvalds/linux/commit/5e2ff6704a275be009be8979af17c52361b79b89&lt;br /&gt;
* [4] Linux kernel https://github.com/torvalds/linux/commit/c679d17d3f2d895b34e660673141ad250889831f&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate / advanced&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Mentors: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
&lt;br /&gt;
We already had a couple (3) of tries for this problem:&lt;br /&gt;
&lt;br /&gt;
* UDP_REPAIR approach didn't succeed: https://lore.kernel.org/netdev/721a2e32-c930-ad6b-5055-631b502ed11b@gmail.com/, https://lore.kernel.org/netdev/?q=udp_repair&lt;br /&gt;
* eBPF (CRIB) approach, socket queue iterator was not merged: https://lore.kernel.org/netdev/AM6PR03MB5848EDA002E3D7EACA7C6BDA99A52@AM6PR03MB5848.eurprd03.prod.outlook.com/, and we have general objections to CRIB approach https://lore.kernel.org/bpf/CAHk-=wjLWFa3i6+Tab67gnNumTYipj_HuheXr2RCq4zn0tCTzA@mail.gmail.com/&lt;br /&gt;
&lt;br /&gt;
We still have one idea we didn't try, as UDP allows packets to be lost on the way on restore we can somehow mark the socket to drop all data before UNCORK. This way we don't really need to restore contents of UDP CORK-ed sockets send queue.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Arm64-GCS&amp;diff=5675</id>
		<title>Arm64-GCS</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Arm64-GCS&amp;diff=5675"/>
		<updated>2025-07-14T17:58:43Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TBD&lt;br /&gt;
&lt;br /&gt;
[[Category:Under the hood]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Arm64-GCS&amp;diff=5674</id>
		<title>Arm64-GCS</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Arm64-GCS&amp;diff=5674"/>
		<updated>2025-07-14T17:55:45Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: Created page with &amp;quot;TBD&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TBD&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5596</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5596"/>
		<updated>2025-02-14T13:51:03Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */ add arm64 Guarded Control Stack (GCS) project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@lists.linux.dev mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Add support for memory compression ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support compression for page images&lt;br /&gt;
 &lt;br /&gt;
We would like to support memory page files compression&lt;br /&gt;
in CRIU using one of the fastest algorithms (it's matter&lt;br /&gt;
of discussion which one to choose!).&lt;br /&gt;
&lt;br /&gt;
This task does not require any Linux kernel modifications&lt;br /&gt;
and scope is limited to CRIU itself. At the same time it's&lt;br /&gt;
complex enough as we need to touch memory dump/restore codepath&lt;br /&gt;
in CRIU and also handle many corner cases like page-server and stuff.&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes operator for managing container checkpoints ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Develop a Kubernetes operator that automates the management of container checkpoints&lt;br /&gt;
&lt;br /&gt;
Container checkpointing has recently been introduced as an alpha feature in Kubernetes.&lt;br /&gt;
To enable this feature, the kubelet API was extended with an endpoint that enables the&lt;br /&gt;
creation of checkpoints for individual containers. By default, all container checkpoints&lt;br /&gt;
are stored as tar archives in &amp;lt;code&amp;gt;/var/lib/kubelet/checkpoints&amp;lt;/code&amp;gt; using the following&lt;br /&gt;
file name format: &amp;lt;code&amp;gt;checkpoint-&amp;lt;pod-name&amp;gt;_&amp;lt;namespace-name&amp;gt;-&amp;lt;container-name&amp;gt;-&amp;lt;timestamp&amp;gt;.tar&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, the current implementation does not provide a mechanism for limiting the number&lt;br /&gt;
of checkpoints, which may lead to filling up all existing disk space. This project aims to&lt;br /&gt;
develop a Kubernetes operator that automates the management of checkpoints and provides&lt;br /&gt;
a garbage collection mechanism to discard obsolete checkpoints.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api/&lt;br /&gt;
* https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/&lt;br /&gt;
* https://kubernetes.io/blog/2023/03/10/forensic-container-analysis/&lt;br /&gt;
* https://github.com/kubernetes/kubernetes/pull/115888&lt;br /&gt;
* https://github.com/kubernetes/enhancements/issues/2008&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber&lt;br /&gt;
&lt;br /&gt;
=== Add support for arm64 Guarded Control Stack (GCS) ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support arm64 Guarded Control Stack (GCS)&lt;br /&gt;
 &lt;br /&gt;
The arm64 Guarded Control Stack (GCS) feature provides support for&lt;br /&gt;
hardware protected stacks of return addresses, intended to provide&lt;br /&gt;
hardening against return oriented programming (ROP) attacks and to make&lt;br /&gt;
it easier to gather call stacks for applications such as profiling (taken from [1]).&lt;br /&gt;
We would like to support arm64 Guarded Control Stack (GCS) in CRIU, which means&lt;br /&gt;
that CRIU should be able to Checkpoint/Restore applications using GCS.&lt;br /&gt;
&lt;br /&gt;
This task should not require any Linux kernel modifications&lt;br /&gt;
but will require a lot of effort to understand Linux kernel and&lt;br /&gt;
glibc support patches. We have a good example of support for&lt;br /&gt;
x86 shadow stack [4] thanks to Mike.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [1] kernel support https://lore.kernel.org/all/20241001-arm64-gcs-v13-0-222b78d87eee@kernel.org&lt;br /&gt;
* [2] libc support https://inbox.sourceware.org/libc-alpha/20250117174119.3254972-1-yury.khrustalev@arm.com&lt;br /&gt;
* [3] libc tests https://inbox.sourceware.org/libc-alpha/20250210114538.1723249-1-yury.khrustalev@arm.com&lt;br /&gt;
* [4] x86 support (a great reference!) https://github.com/checkpoint-restore/criu/pull/2306&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (a lot of moving parts: Linux kernel / libc / CRIU)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Mike Rapoport &amp;lt;rppt@kernel.org&amp;gt;&lt;br /&gt;
* Mentors: Mike Rapoport &amp;lt;rppt@kernel.org&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5595</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5595"/>
		<updated>2025-02-14T12:35:47Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Suspended project ideas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@lists.linux.dev mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Add support for memory compression ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support compression for page images&lt;br /&gt;
 &lt;br /&gt;
We would like to support memory page files compression&lt;br /&gt;
in CRIU using one of the fastest algorithms (it's matter&lt;br /&gt;
of discussion which one to choose!).&lt;br /&gt;
&lt;br /&gt;
This task does not require any Linux kernel modifications&lt;br /&gt;
and scope is limited to CRIU itself. At the same time it's&lt;br /&gt;
complex enough as we need to touch memory dump/restore codepath&lt;br /&gt;
in CRIU and also handle many corner cases like page-server and stuff.&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes operator for managing container checkpoints ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Develop a Kubernetes operator that automates the management of container checkpoints&lt;br /&gt;
&lt;br /&gt;
Container checkpointing has recently been introduced as an alpha feature in Kubernetes.&lt;br /&gt;
To enable this feature, the kubelet API was extended with an endpoint that enables the&lt;br /&gt;
creation of checkpoints for individual containers. By default, all container checkpoints&lt;br /&gt;
are stored as tar archives in &amp;lt;code&amp;gt;/var/lib/kubelet/checkpoints&amp;lt;/code&amp;gt; using the following&lt;br /&gt;
file name format: &amp;lt;code&amp;gt;checkpoint-&amp;lt;pod-name&amp;gt;_&amp;lt;namespace-name&amp;gt;-&amp;lt;container-name&amp;gt;-&amp;lt;timestamp&amp;gt;.tar&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, the current implementation does not provide a mechanism for limiting the number&lt;br /&gt;
of checkpoints, which may lead to filling up all existing disk space. This project aims to&lt;br /&gt;
develop a Kubernetes operator that automates the management of checkpoints and provides&lt;br /&gt;
a garbage collection mechanism to discard obsolete checkpoints.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api/&lt;br /&gt;
* https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/&lt;br /&gt;
* https://kubernetes.io/blog/2023/03/10/forensic-container-analysis/&lt;br /&gt;
* https://github.com/kubernetes/kubernetes/pull/115888&lt;br /&gt;
* https://github.com/kubernetes/enhancements/issues/2008&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5594</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5594"/>
		<updated>2025-02-14T12:35:35Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@lists.linux.dev mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Add support for memory compression ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support compression for page images&lt;br /&gt;
 &lt;br /&gt;
We would like to support memory page files compression&lt;br /&gt;
in CRIU using one of the fastest algorithms (it's matter&lt;br /&gt;
of discussion which one to choose!).&lt;br /&gt;
&lt;br /&gt;
This task does not require any Linux kernel modifications&lt;br /&gt;
and scope is limited to CRIU itself. At the same time it's&lt;br /&gt;
complex enough as we need to touch memory dump/restore codepath&lt;br /&gt;
in CRIU and also handle many corner cases like page-server and stuff.&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes operator for managing container checkpoints ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Develop a Kubernetes operator that automates the management of container checkpoints&lt;br /&gt;
&lt;br /&gt;
Container checkpointing has recently been introduced as an alpha feature in Kubernetes.&lt;br /&gt;
To enable this feature, the kubelet API was extended with an endpoint that enables the&lt;br /&gt;
creation of checkpoints for individual containers. By default, all container checkpoints&lt;br /&gt;
are stored as tar archives in &amp;lt;code&amp;gt;/var/lib/kubelet/checkpoints&amp;lt;/code&amp;gt; using the following&lt;br /&gt;
file name format: &amp;lt;code&amp;gt;checkpoint-&amp;lt;pod-name&amp;gt;_&amp;lt;namespace-name&amp;gt;-&amp;lt;container-name&amp;gt;-&amp;lt;timestamp&amp;gt;.tar&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, the current implementation does not provide a mechanism for limiting the number&lt;br /&gt;
of checkpoints, which may lead to filling up all existing disk space. This project aims to&lt;br /&gt;
develop a Kubernetes operator that automates the management of checkpoints and provides&lt;br /&gt;
a garbage collection mechanism to discard obsolete checkpoints.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api/&lt;br /&gt;
* https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/&lt;br /&gt;
* https://kubernetes.io/blog/2023/03/10/forensic-container-analysis/&lt;br /&gt;
* https://github.com/kubernetes/kubernetes/pull/115888&lt;br /&gt;
* https://github.com/kubernetes/enhancements/issues/2008&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Main_Page&amp;diff=5593</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Main_Page&amp;diff=5593"/>
		<updated>2025-02-14T12:21:36Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: update CRIU mailing list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: {{{1|right}}}&amp;quot;&amp;gt;&lt;br /&gt;
{{Download box|left}}&lt;br /&gt;
[[Image:4.0.c.jpg|right|340px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;big&amp;gt;Welcome to CRIU, a project to implement checkpoint/restore functionality for Linux.&lt;br /&gt;
&lt;br /&gt;
Checkpoint/Restore In Userspace, or CRIU (pronounced kree-oo, IPA: /krɪʊ/, Russian: криу), is a Linux software. It can freeze a running container (or an individual application) and checkpoint its state to disk. The data saved can be used to restore the application and run it exactly as it was during the time of the freeze. Using this functionality, application or container live migration, snapshots, remote debugging, and [[usage scenarios|many other things]] are now possible.&lt;br /&gt;
&lt;br /&gt;
CRIU started as a project of Virtuozzo, and grew with the tremendous help from the [[community]]. It is currently used by (integrated into) OpenVZ, [[LXC]]/LXD, [[Docker]], [[Podman]], and [[Integration|other software]], and [[packages|packaged for many Linux distributions]].&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
{{Like}}&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;m_right&amp;quot;&amp;gt;&lt;br /&gt;
{{News block 2}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;m_left&amp;quot;&amp;gt;&lt;br /&gt;
== Using ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
;Getting [[packages]] for your distribution&lt;br /&gt;
: Or try manual [[installation]] to have CRIU on your system&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[CLI]], [[RPC]] and [[C API]]&lt;br /&gt;
: Three ways to start using the C/R functionality.  [[:Category:API|More info]] about APIs.&lt;br /&gt;
&lt;br /&gt;
;[[Usage scenarios]]&lt;br /&gt;
: Ideas how criu can be used (some are crazy indeed)&lt;br /&gt;
&lt;br /&gt;
;[[:Category:HOWTO]]&lt;br /&gt;
: Collection of real world examples of how to use CRIU. Some are complex, some are not. HOW TO dump a [[simple loop]] might be the best one to start with. Also a set of [[asciinema]] records for real-life examples.&lt;br /&gt;
&lt;br /&gt;
;[https://www.criu.org/index.php?title=FAQ FAQ] &amp;amp; [[When C/R fails]]&lt;br /&gt;
: A sort of troubleshooting guide&lt;br /&gt;
&lt;br /&gt;
;[[What can change after C/R]]&lt;br /&gt;
: CRIU cannot (yet) save and restore every single bit of tasks' state. This page describes what bits visible through standard kernel API are such.&lt;br /&gt;
&lt;br /&gt;
;[[What cannot be checkpointed]]&lt;br /&gt;
: What an application could do to make CRIU refuse to dump it.&lt;br /&gt;
&lt;br /&gt;
;[[Contacts]]&lt;br /&gt;
: Ways to communicate with CRIU community&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;m_center&amp;quot;&amp;gt;&lt;br /&gt;
== Developing ==&lt;br /&gt;
If you're interested in CRIU development, please subscribe to the criu mailing list: https://lore.kernel.org/criu/ (old one is https://lists.openvz.org/mailman/listinfo/criu)&lt;br /&gt;
&lt;br /&gt;
;[[Images]]&lt;br /&gt;
: Description of image files format&lt;br /&gt;
&lt;br /&gt;
;[[Plugins]]&lt;br /&gt;
: CRIU can call plugins provided by people&lt;br /&gt;
&lt;br /&gt;
;[[Upstream kernel commits]]&lt;br /&gt;
: Mainline kernel commits tracker&lt;br /&gt;
&lt;br /&gt;
;[[Recent commits]]&lt;br /&gt;
: CRIU tool repository commits&lt;br /&gt;
&lt;br /&gt;
;[[Manpages]]&lt;br /&gt;
: Kernel's manpages commits tracker&lt;br /&gt;
&lt;br /&gt;
;[[ZDTM Test Suite]]&lt;br /&gt;
: Zero downtime test suite&lt;br /&gt;
&lt;br /&gt;
;[[Todo|TODO]]&lt;br /&gt;
: Current TODO list&lt;br /&gt;
&lt;br /&gt;
;[[User namespace]]&lt;br /&gt;
: Implementing user namespace support&lt;br /&gt;
&lt;br /&gt;
;[[Postulates]]&lt;br /&gt;
: What to keep in mind when writing new code&lt;br /&gt;
&lt;br /&gt;
;[https://coveralls.io/github/checkpoint-restore/criu Code coverage results]&lt;br /&gt;
: Shows how zdtm run covers the criu code paths&lt;br /&gt;
&lt;br /&gt;
;[[How to submit patches]]&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;m_left&amp;quot;&amp;gt;&lt;br /&gt;
== Under the hood ==&lt;br /&gt;
* [[Checkpoint/Restore]]&lt;br /&gt;
* [[:Category:Under the hood]]&lt;br /&gt;
* [[:Category:Network]]&lt;br /&gt;
* [[:Category:Files]]&lt;br /&gt;
* [[:Category:Memory]]&lt;br /&gt;
* [[Pending signals]]&lt;br /&gt;
* [[Stages of restoring]]&lt;br /&gt;
* [[Code blobs]]&lt;br /&gt;
* [[Comparison to other CR projects]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;m_center&amp;quot;&amp;gt;&lt;br /&gt;
== External links ==&lt;br /&gt;
{{:Articles}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;m_right&amp;quot;&amp;gt;&lt;br /&gt;
== Misc ==&lt;br /&gt;
* [[Academic Research]]&lt;br /&gt;
* [[Podcasts]] and other audio/video interviews&lt;br /&gt;
* Project [[history]]&lt;br /&gt;
* [[Logo]] description&lt;br /&gt;
* [[Events]]&lt;br /&gt;
* [[CRIU acronym fun]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5592</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5592"/>
		<updated>2025-02-14T12:19:22Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: update CRIU mailing list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@lists.linux.dev mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Add support for memory compression ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support compression for page images&lt;br /&gt;
 &lt;br /&gt;
We would like to support memory page files compression&lt;br /&gt;
in CRIU using one of the fastest algorithms (it's matter&lt;br /&gt;
of discussion which one to choose!).&lt;br /&gt;
&lt;br /&gt;
This task does not require any Linux kernel modifications&lt;br /&gt;
and scope is limited to CRIU itself. At the same time it's&lt;br /&gt;
complex enough as we need to touch memory dump/restore codepath&lt;br /&gt;
in CRIU and also handle many corner cases like page-server and stuff.&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes operator for managing container checkpoints ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Develop a Kubernetes operator that automates the management of container checkpoints&lt;br /&gt;
&lt;br /&gt;
Container checkpointing has recently been introduced as an alpha feature in Kubernetes.&lt;br /&gt;
To enable this feature, the kubelet API was extended with an endpoint that enables the&lt;br /&gt;
creation of checkpoints for individual containers. By default, all container checkpoints&lt;br /&gt;
are stored as tar archives in &amp;lt;code&amp;gt;/var/lib/kubelet/checkpoints&amp;lt;/code&amp;gt; using the following&lt;br /&gt;
file name format: &amp;lt;code&amp;gt;checkpoint-&amp;lt;pod-name&amp;gt;_&amp;lt;namespace-name&amp;gt;-&amp;lt;container-name&amp;gt;-&amp;lt;timestamp&amp;gt;.tar&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, the current implementation does not provide a mechanism for limiting the number&lt;br /&gt;
of checkpoints, which may lead to filling up all existing disk space. This project aims to&lt;br /&gt;
develop a Kubernetes operator that automates the management of checkpoints and provides&lt;br /&gt;
a garbage collection mechanism to discard obsolete checkpoints.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api/&lt;br /&gt;
* https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/&lt;br /&gt;
* https://kubernetes.io/blog/2023/03/10/forensic-container-analysis/&lt;br /&gt;
* https://github.com/kubernetes/kubernetes/pull/115888&lt;br /&gt;
* https://github.com/kubernetes/enhancements/issues/2008&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5464</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5464"/>
		<updated>2024-03-12T17:45:50Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Add support for memory compression ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support compression for page images&lt;br /&gt;
 &lt;br /&gt;
We would like to support memory page files compression&lt;br /&gt;
in CRIU using one of the fastest algorithms (it's matter&lt;br /&gt;
of discussion which one to choose!).&lt;br /&gt;
&lt;br /&gt;
This task does not require any Linux kernel modifications&lt;br /&gt;
and scope is limited to CRIU itself. At the same time it's&lt;br /&gt;
complex enough as we need to touch memory dump/restore codepath&lt;br /&gt;
in CRIU and also handle many corner cases like page-server and stuff.&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian@brauner.io&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes operator for managing container checkpoints ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Develop a Kubernetes operator that automates the management of container checkpoints&lt;br /&gt;
&lt;br /&gt;
Container checkpointing has recently been introduced as an alpha feature in Kubernetes.&lt;br /&gt;
To enable this feature, the kubelet API was extended with an endpoint that enables the&lt;br /&gt;
creation of checkpoints for individual containers. By default, all container checkpoints&lt;br /&gt;
are stored as tar archives in &amp;lt;code&amp;gt;/var/lib/kubelet/checkpoints&amp;lt;/code&amp;gt; using the following&lt;br /&gt;
file name format: &amp;lt;code&amp;gt;checkpoint-&amp;lt;pod-name&amp;gt;_&amp;lt;namespace-name&amp;gt;-&amp;lt;container-name&amp;gt;-&amp;lt;timestamp&amp;gt;.tar&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, the current implementation does not provide a mechanism for limiting the number&lt;br /&gt;
of checkpoints, which may lead to filling up all existing disk space. This project aims to&lt;br /&gt;
develop a Kubernetes operator that automates the management of checkpoints and provides&lt;br /&gt;
a garbage collection mechanism to discard obsolete checkpoints.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api/&lt;br /&gt;
* https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/&lt;br /&gt;
* https://kubernetes.io/blog/2023/03/10/forensic-container-analysis/&lt;br /&gt;
* https://github.com/kubernetes/kubernetes/pull/115888&lt;br /&gt;
* https://github.com/kubernetes/enhancements/issues/2008&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5463</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5463"/>
		<updated>2024-03-12T16:33:03Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian@brauner.io&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes operator for managing container checkpoints ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Develop a Kubernetes operator that automates the management of container checkpoints&lt;br /&gt;
&lt;br /&gt;
Container checkpointing has recently been introduced as an alpha feature in Kubernetes.&lt;br /&gt;
To enable this feature, the kubelet API was extended with an endpoint that enables the&lt;br /&gt;
creation of checkpoints for individual containers. By default, all container checkpoints&lt;br /&gt;
are stored as tar archives in &amp;lt;code&amp;gt;/var/lib/kubelet/checkpoints&amp;lt;/code&amp;gt; using the following&lt;br /&gt;
file name format: &amp;lt;code&amp;gt;checkpoint-&amp;lt;pod-name&amp;gt;_&amp;lt;namespace-name&amp;gt;-&amp;lt;container-name&amp;gt;-&amp;lt;timestamp&amp;gt;.tar&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, the current implementation does not provide a mechanism for limiting the number&lt;br /&gt;
of checkpoints, which may lead to filling up all existing disk space. This project aims to&lt;br /&gt;
develop a Kubernetes operator that automates the management of checkpoints and provides&lt;br /&gt;
a garbage collection mechanism to discard obsolete checkpoints.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api/&lt;br /&gt;
* https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/&lt;br /&gt;
* https://kubernetes.io/blog/2023/03/10/forensic-container-analysis/&lt;br /&gt;
* https://github.com/kubernetes/kubernetes/pull/115888&lt;br /&gt;
* https://github.com/kubernetes/enhancements/issues/2008&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5462</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5462"/>
		<updated>2024-03-12T16:32:54Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Suspended project ideas */ moved &amp;quot;Optimize logging engine&amp;quot; to suspended projects list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* https://github.com/criupatchwork/criu/commit/a532312&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian@brauner.io&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checkpointing of POSIX message queues ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Add support for checkpoint/restore of POSIX message queues&lt;br /&gt;
&lt;br /&gt;
POSIX message queues are a widely used inter-process communication mechanism. Message queues are implemented as files on a virtual filesystem (mqueue), where a file descriptor (message queue descriptor) is used to perform operations such as sending or receiving messages. To support checkpoint/restore of POSIX message queues, we need a kernel interface (similar to [https://github.com/checkpoint-restore/criu/commit/8ce9e947051e43430eb2ff06b96dddeba467b4fd MSG_PEEK]) that would enable the retrieval of messages from a queue without removing them. This project aims to implement such an interface that allows retrieving all messages and their priorities from a POSIX message queue.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/2285&lt;br /&gt;
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ipc/mqueue.c&lt;br /&gt;
* https://www.man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kubernetes operator for managing container checkpoints ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Develop a Kubernetes operator that automates the management of container checkpoints&lt;br /&gt;
&lt;br /&gt;
Container checkpointing has recently been introduced as an alpha feature in Kubernetes.&lt;br /&gt;
To enable this feature, the kubelet API was extended with an endpoint that enables the&lt;br /&gt;
creation of checkpoints for individual containers. By default, all container checkpoints&lt;br /&gt;
are stored as tar archives in &amp;lt;code&amp;gt;/var/lib/kubelet/checkpoints&amp;lt;/code&amp;gt; using the following&lt;br /&gt;
file name format: &amp;lt;code&amp;gt;checkpoint-&amp;lt;pod-name&amp;gt;_&amp;lt;namespace-name&amp;gt;-&amp;lt;container-name&amp;gt;-&amp;lt;timestamp&amp;gt;.tar&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, the current implementation does not provide a mechanism for limiting the number&lt;br /&gt;
of checkpoints, which may lead to filling up all existing disk space. This project aims to&lt;br /&gt;
develop a Kubernetes operator that automates the management of checkpoints and provides&lt;br /&gt;
a garbage collection mechanism to discard obsolete checkpoints.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/checkpoint-restore-operator&lt;br /&gt;
* https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api/&lt;br /&gt;
* https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/&lt;br /&gt;
* https://kubernetes.io/blog/2023/03/10/forensic-container-analysis/&lt;br /&gt;
* https://github.com/kubernetes/kubernetes/pull/115888&lt;br /&gt;
* https://github.com/kubernetes/enhancements/issues/2008&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;, Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Prajwal S N &amp;lt;prajwalnadig21@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Supported_architectures&amp;diff=5417</id>
		<title>Supported architectures</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Supported_architectures&amp;diff=5417"/>
		<updated>2023-08-07T16:58:12Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: Add page with list/info about all supported architectures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! Arch !! Status !! Link to PR when added !! Comment or wiki page link&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| x86_64&lt;br /&gt;
| Supported&lt;br /&gt;
|&lt;br /&gt;
| Main architecture&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| s390&lt;br /&gt;
| Maintained&lt;br /&gt;
|&lt;br /&gt;
| -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| ppc64le&lt;br /&gt;
| Maintained&lt;br /&gt;
|&lt;br /&gt;
| -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| arm&lt;br /&gt;
| Maintained&lt;br /&gt;
|&lt;br /&gt;
| -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| arm64&lt;br /&gt;
| Maintained&lt;br /&gt;
|&lt;br /&gt;
| -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| loongarch&lt;br /&gt;
| Maintained&lt;br /&gt;
| https://github.com/checkpoint-restore/criu/pull/2183&lt;br /&gt;
| -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| riscv&lt;br /&gt;
| In development&lt;br /&gt;
| https://github.com/checkpoint-restore/criu/pull/2234&lt;br /&gt;
| -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| mips&lt;br /&gt;
| Unknown/Orphan&lt;br /&gt;
| https://github.com/checkpoint-restore/criu/pull/933&lt;br /&gt;
| -&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code&amp;diff=5397</id>
		<title>Google Summer of Code</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code&amp;diff=5397"/>
		<updated>2023-03-17T11:39:16Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* What are the requirements to be accepted for GSoC? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:GSoC]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[https://summerofcode.withgoogle.com/ Google Summer of Code] (GSoC) is a program where Google pairs university students with open source organizations to work together over the summer. For their efforts, students are rewarded with stipends provided by Google. During the summer break students work on ideas for open-souce projects while mentors from the projects help them by providing support and code reviews.&lt;br /&gt;
&lt;br /&gt;
== What are the requirements to be accepted for GSoC? ==&lt;br /&gt;
Apart from the [https://developers.google.com/open-source/gsoc/faq#what_are_the_eligibility_requirements_for_participation official requirements] you will have to meet the following:&lt;br /&gt;
&lt;br /&gt;
* Successfully clone and compile CRIU&lt;br /&gt;
* Subscribe to the [https://openvz.org/mailman/listinfo/criu mailing list]&lt;br /&gt;
* Join the CRIU community in [https://gitter.im/save-restore/CRIU Gitter]&lt;br /&gt;
* Read [[GSoC Students Recommendations]]&lt;br /&gt;
* Have a small upstream contribution ([https://github.com/checkpoint-restore/criu/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue good first issues])&lt;br /&gt;
&lt;br /&gt;
== How can I have an upstream contribution? ==&lt;br /&gt;
As strange as it might look like, this is a proof that you have managed to clone and build your own CRIU, and subscribed to the list.&lt;br /&gt;
Don't worry, there are no requirements on the initial contribution when it comes to complexity or a size of the change.&lt;br /&gt;
Before working on a patch, please read  [[Installation]], [[How to submit patches]] and [https://github.com/checkpoint-restore/criu/blob/criu-dev/CONTRIBUTING.md Contributing guide]&lt;br /&gt;
&lt;br /&gt;
== Project Ideas ==&lt;br /&gt;
&lt;br /&gt;
The project ideas are listed in [[Google Summer of Code Ideas]].&lt;br /&gt;
&lt;br /&gt;
== Completed projects ==&lt;br /&gt;
&lt;br /&gt;
Several projects successfully [[GSoC completed projects|graduated GSoC]] and they are now an integral part of CRIU&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code&amp;diff=5396</id>
		<title>Google Summer of Code</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code&amp;diff=5396"/>
		<updated>2023-03-17T11:34:51Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* What are the requirements to be accepted for GSoC? */ add Gitter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:GSoC]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[https://summerofcode.withgoogle.com/ Google Summer of Code] (GSoC) is a program where Google pairs university students with open source organizations to work together over the summer. For their efforts, students are rewarded with stipends provided by Google. During the summer break students work on ideas for open-souce projects while mentors from the projects help them by providing support and code reviews.&lt;br /&gt;
&lt;br /&gt;
== What are the requirements to be accepted for GSoC? ==&lt;br /&gt;
Apart from the [https://developers.google.com/open-source/gsoc/faq#what_are_the_eligibility_requirements_for_participation official requirements] you will have to meet the following:&lt;br /&gt;
&lt;br /&gt;
* Successfully clone and compile CRIU&lt;br /&gt;
* Subscribe to the [https://openvz.org/mailman/listinfo/criu mailing list]&lt;br /&gt;
* Join the CRIU community in [https://gitter.im/save-restore/CRIU Gitter]&lt;br /&gt;
* Have a small upstream contribution ([https://github.com/checkpoint-restore/criu/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue good first issues])&lt;br /&gt;
&lt;br /&gt;
== How can I have an upstream contribution? ==&lt;br /&gt;
As strange as it might look like, this is a proof that you have managed to clone and build your own CRIU, and subscribed to the list.&lt;br /&gt;
Don't worry, there are no requirements on the initial contribution when it comes to complexity or a size of the change.&lt;br /&gt;
Before working on a patch, please read  [[Installation]], [[How to submit patches]] and [https://github.com/checkpoint-restore/criu/blob/criu-dev/CONTRIBUTING.md Contributing guide]&lt;br /&gt;
&lt;br /&gt;
== Project Ideas ==&lt;br /&gt;
&lt;br /&gt;
The project ideas are listed in [[Google Summer of Code Ideas]].&lt;br /&gt;
&lt;br /&gt;
== Completed projects ==&lt;br /&gt;
&lt;br /&gt;
Several projects successfully [[GSoC completed projects|graduated GSoC]] and they are now an integral part of CRIU&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code&amp;diff=5386</id>
		<title>Google Summer of Code</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code&amp;diff=5386"/>
		<updated>2023-03-13T10:28:43Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: added good first issues link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:GSoC]]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[https://summerofcode.withgoogle.com/ Google Summer of Code] (GSoC) is a program where Google pairs university students with open source organizations to work together over the summer. For their efforts, students are rewarded with stipends provided by Google. During the summer break students work on ideas for open-souce projects while mentors from the projects help them by providing support and code reviews.&lt;br /&gt;
&lt;br /&gt;
== What are the requirements to be accepted for GSoC? ==&lt;br /&gt;
Apart from the [https://developers.google.com/open-source/gsoc/faq#what_are_the_eligibility_requirements_for_participation official requirements] you will have to meet the following:&lt;br /&gt;
&lt;br /&gt;
* Successfully clone and compile CRIU&lt;br /&gt;
* Subscribe to the [https://openvz.org/mailman/listinfo/criu mailing list]&lt;br /&gt;
* Have a small upstream contribution ([https://github.com/checkpoint-restore/criu/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue good first issues])&lt;br /&gt;
&lt;br /&gt;
== How can I have an upstream contribution? ==&lt;br /&gt;
As strange as it might look like, this is a proof that you have managed to clone and build your own CRIU, and subscribed to the list.&lt;br /&gt;
Don't worry, there are no requirements on the initial contribution when it comes to complexity or a size of the change.&lt;br /&gt;
Before working on a patch, please read  [[Installation]], [[How to submit patches]] and [https://github.com/checkpoint-restore/criu/blob/criu-dev/CONTRIBUTING.md Contributing guide]&lt;br /&gt;
&lt;br /&gt;
== Project Ideas ==&lt;br /&gt;
&lt;br /&gt;
The project ideas are listed in [[Google Summer of Code Ideas]].&lt;br /&gt;
&lt;br /&gt;
== Completed projects ==&lt;br /&gt;
&lt;br /&gt;
Several projects successfully [[GSoC completed projects|graduated GSoC]] and they are now an integral part of CRIU&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5374</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5374"/>
		<updated>2023-02-27T17:29:17Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: updated my email&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian@brauner.io&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for memfd_secret file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of memfd_secret descriptors&lt;br /&gt;
&lt;br /&gt;
There is memfd_secret syscall which allows user to open&lt;br /&gt;
special memfd which is backed by special memory range which&lt;br /&gt;
is inaccessible by another processes (and the kernel too!).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have memfd_secret's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/865256/&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Mike Rapoport &amp;lt;mike.rapoport@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Forensic analysis of container checkpoints ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Extending go-crit with capabilities for forensic analysis&lt;br /&gt;
&lt;br /&gt;
The go-crit tool was created during GSoC 2022 to enable analysis of CRIU [[images]] with tools written in Go. It allows container management tools such as [https://github.com/checkpoint-restore/checkpointctl checkpointctl] and Podman to provide capabilities similar to CRIT. The goal of this project is to extend go-crit with functionality for forensic analysis of container checkpoints to provide a better user experience.&lt;br /&gt;
&lt;br /&gt;
The go-crit tool is still in its early stages of development. To effectively utilise this new feature, the checkpointctl tool would be extended to display information about the processes included in a container checkpoint and their runtime state (e.g., memory, open files, sockets, etc).&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://criu.org/CRIT_(Go_library)&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/tree/master/crit&lt;br /&gt;
* https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;, Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
* Suggested by: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files on detached mounts ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Initial support of open files on &amp;quot;detached&amp;quot; mounts&lt;br /&gt;
&lt;br /&gt;
When criu dumps a process with an open fd on a file, it gets the mount identifier (mnt_id) via /proc/&amp;lt;pid&amp;gt;/fdinfo/&amp;lt;fd&amp;gt;, so that criu knows from which exact mount the file was initially opened. This way criu can restore this fd by opening the same exact file from topologically the same mount in restored mount tree.&lt;br /&gt;
&lt;br /&gt;
Restoring fd from the right mount can be important in different cases, for instance if the process would later want to resolve paths relative to the fd, and obviously resolving from the same file on different mount can lead to different resolved paths, or if the process wants to check path to the file via /proc/&amp;lt;pid&amp;gt;/fd/&amp;lt;fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
But we have a problem finding on which mount we need to reopen the file at restore if we only know mnt_id but can't find this mnt_id in /proc/&amp;lt;pid&amp;gt;/mountinfo.&lt;br /&gt;
&lt;br /&gt;
Mountinfo file shows the mount tree topology of current mntns: parent - child relations, sharing group information, mountpoint and fs root information. And if we don't see mnt_id in it we don't know anything about this mount.&lt;br /&gt;
&lt;br /&gt;
This can happen in two cases&lt;br /&gt;
&lt;br /&gt;
* 1) external mount or file - if file was opened from e.g. host it's mount would not be visible in container mountinfo&lt;br /&gt;
* 2) mount was lazily unmounted&lt;br /&gt;
&lt;br /&gt;
In case of 1) we have criu options to help criu handle external dependencies.&lt;br /&gt;
&lt;br /&gt;
In case of 2) or no options provided criu can't resolve mnt_id in mountinfo and criu fails.&lt;br /&gt;
&lt;br /&gt;
'''Solution:'''&lt;br /&gt;
We can handle 2) with: resolving major/minor via fstat, using name_to_handle_at and open_by_handle_at to open same file on any other available mount from same superblock (same major/minor) in container. Now we have fd2 of the same file as fd, but on existing mount we can dump it as usual instead, and mark it as &amp;quot;detached&amp;quot; in image, now criu on restore knows where to find this file, but instead of just opening fd2 from actually restored mount, we create a temporary bindmount which is lazy unmounted just after open making the file appear as a file on detached mount.&lt;br /&gt;
&lt;br /&gt;
Known problems with this approach:&lt;br /&gt;
&lt;br /&gt;
* Stat on btrfs gives wrong major/minor&lt;br /&gt;
* file handles does not work everywhere&lt;br /&gt;
* file handles can return fd2 on deleted file or on other hardlink, this needs special handling.&lt;br /&gt;
&lt;br /&gt;
Additionally (optional part):&lt;br /&gt;
We can export real major/minor in fdinfo (kernel).&lt;br /&gt;
We can think of new kernel interface to get mount's major/minor and root (shift from fsroot) for detached mounts, if we have it we don't need file handle hack to find file on other mount (see fsinfo or getvalues kernel patches in LKML, can we add this info there?).&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=File:3.17.jpg&amp;diff=5270</id>
		<title>File:3.17.jpg</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=File:3.17.jpg&amp;diff=5270"/>
		<updated>2022-04-25T16:03:01Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: Amikhalitsyn moved page File:3.17.JPG to File:3.17.jpg without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
http://woodswalksandwildlife.blogspot.com/2012/09/american-redstart.html&lt;br /&gt;
&lt;br /&gt;
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=File:3.17.jpg&amp;diff=5269</id>
		<title>File:3.17.jpg</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=File:3.17.jpg&amp;diff=5269"/>
		<updated>2022-04-25T16:01:34Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: http://woodswalksandwildlife.blogspot.com/2012/09/american-redstart.html

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
http://woodswalksandwildlife.blogspot.com/2012/09/american-redstart.html&lt;br /&gt;
&lt;br /&gt;
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Download/criu/3.17&amp;diff=5268</id>
		<title>Download/criu/3.17</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Download/criu/3.17&amp;diff=5268"/>
		<updated>2022-04-25T15:51:39Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: Created page with &amp;quot;&amp;lt;!--       **** FOR STEPS NEEDED TO MAKE A RELEASE, SEE https://criu.org/Releasing       Use {{Bug|123}} to link to a github issue --&amp;gt; right {{Release...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&lt;br /&gt;
      **** FOR STEPS NEEDED TO MAKE A RELEASE, SEE https://criu.org/Releasing&lt;br /&gt;
      Use {{Bug|123}} to link to a github issue&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[[Image:3.17.jpg|400px|right]]&lt;br /&gt;
{{Release|3.17}}&lt;br /&gt;
&lt;br /&gt;
=== New features ===&lt;br /&gt;
* Introduced [[Mount-v2|mount-v2 engine]]&lt;br /&gt;
* Added support for MAP_HUGETLB mappings&lt;br /&gt;
* Added support for [[Rseq|Linux Restartable Sequences]]&lt;br /&gt;
* Added support for SOCK_SEQPACKET unix sockets&lt;br /&gt;
* CRIU AMD GPU plugin&lt;br /&gt;
&lt;br /&gt;
=== Bugfixes ===&lt;br /&gt;
* GCC 12 compatibility fixes&lt;br /&gt;
* cgroup: fix --manage-cgroups=ignore&lt;br /&gt;
* several memory leaks fixed in net, files, mount, tun and config subsystems&lt;br /&gt;
&lt;br /&gt;
=== Improvements ===&lt;br /&gt;
* bpf: switch from deprecated bpf_create_map_xattr to bpf_map_create&lt;br /&gt;
* bpfmap: handle map_extra field&lt;br /&gt;
* setsockopt(SO_BUF_LOCK) support for tcp sockets&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Template:Codename&amp;diff=5267</id>
		<title>Template:Codename</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Template:Codename&amp;diff=5267"/>
		<updated>2022-04-25T15:34:15Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: add v3.17 Radiant Redstart&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#switch: v{{{1}}}&lt;br /&gt;
 | v2.1  = Steel Lapwing&lt;br /&gt;
 | v2.2  = Carbon Nightingale&lt;br /&gt;
 | v2.3  = Wooden Duck&lt;br /&gt;
 | v2.4  = Marble Lark&lt;br /&gt;
 | v2.5  = Concrete Oriole&lt;br /&gt;
 | v2.6  = Paper Crane&lt;br /&gt;
 | v2.7  = Rubber Owl&lt;br /&gt;
 | v2.8  = Bronze Siskin&lt;br /&gt;
 | v2.9  = Silk Tit&lt;br /&gt;
 | v2.10 = Brass Waxwing&lt;br /&gt;
 | v2.11 = Acrylic Bullfinch&lt;br /&gt;
 | v2.12 = Vulcanite Rook&lt;br /&gt;
 | v3.0 = Basalt Wagtail&lt;br /&gt;
 | v3.1 = Graphene Swift&lt;br /&gt;
 | v3.2 = Tin Hoopoe&lt;br /&gt;
 | v3.3 = Crystal Pelican&lt;br /&gt;
 | v3.4 = Cobalt Swan&lt;br /&gt;
 | v3.5 = Clay Jay&lt;br /&gt;
 | v3.6 = Alabaster Finch&lt;br /&gt;
 | v3.7 = Vinyl Magpie&lt;br /&gt;
 | v3.8 = Snow Bunting&lt;br /&gt;
 | v3.9 = Sand Martin&lt;br /&gt;
 | v3.10 = Granite Eagle&lt;br /&gt;
 | v3.11 = Glass Flamingo&lt;br /&gt;
 | v3.12 = Ice Penguin&lt;br /&gt;
 | v3.13 = Silicon Willet&lt;br /&gt;
 | v3.14 = Platinum Peacock&lt;br /&gt;
 | v3.15 = Titanium Falcon&lt;br /&gt;
 | v3.16 = Petrified Puffin&lt;br /&gt;
 | v3.16.1 = Petrified Puffin&lt;br /&gt;
 | v3.17 = Radiant Redstart&lt;br /&gt;
 | &amp;lt;!-- no codename --&amp;gt;&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template is used to get the codename of a specified release. If there is no codename, empty string is produced.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;{{Codename|VERSION}}&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 ! Markup&lt;br /&gt;
 ! Result&lt;br /&gt;
 |-&lt;br /&gt;
 | &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;{{Codename|3.3}}&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 | {{Codename|3.3}}&lt;br /&gt;
 |-&lt;br /&gt;
 | &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;{{Codename|2.1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 | {{Codename|2.1}}&lt;br /&gt;
 |-&lt;br /&gt;
 | &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;{{Codename|2.0}}&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 | {{Codename|2.0}}&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Release schedule]] for future codenames&lt;br /&gt;
* [[Template:Release date]]&lt;br /&gt;
* [[Template:criu]]&lt;br /&gt;
* [[Template:Release]]&lt;br /&gt;
* [[Template:Latest release]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5266</id>
		<title>Restartable Sequences</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5266"/>
		<updated>2022-04-20T06:20:52Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;Restartable sequences&amp;quot; (&amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt;) are small segments of user-space code designed to access per-CPU data structures without the need for heavyweight locking.&lt;br /&gt;
rseq is supported since Linux kernel 4.18 [1]&lt;br /&gt;
&lt;br /&gt;
I strongly suggest reading the article [https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/ Linux restartable sequences] before this one.&lt;br /&gt;
&lt;br /&gt;
== Linux kernel interface ==&lt;br /&gt;
&lt;br /&gt;
The Linux kernel interface for rseq is fairly simple. It's just &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall:&lt;br /&gt;
&amp;lt;code&amp;gt;sys_rseq(struct rseq *rseq, uint32_t rseq_len, int flags, uint32_t sig)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum rseq_cs_flags {&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct rseq_cs {&lt;br /&gt;
	__u32 version; /* always 0 at this moment */&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
	void *start_ip;&lt;br /&gt;
	/* Offset from start_ip. */&lt;br /&gt;
	intptr_t post_commit_offset;&lt;br /&gt;
	void *abort_ip;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
struct rseq {&lt;br /&gt;
	__u32 cpu_id_start;&lt;br /&gt;
	__u32 cpu_id;&lt;br /&gt;
	struct rseq_cs *rseq_cs;&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the userspace side, we need to keep &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; somewhere and register it on the kernel side using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall.&lt;br /&gt;
Then, once we want to execute some code as a rseq critical section (&amp;lt;code&amp;gt;rseq cs&amp;lt;/code&amp;gt; or just CS) we need to allocate and fill with the data&lt;br /&gt;
&amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt;. We have to specify the start address of our CS, and the address of the abort handler (called when CS was interrupted by a preemption, migration&lt;br /&gt;
or signal). Then we need to put an pointer to &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
== What about &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
You may have noticed that both &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; have &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; field. It may took values from &amp;lt;code&amp;gt;enum rseq_cs_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First of all, a user may specify flags in any place they will be combined on the kernel side:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static int rseq_need_restart(struct task_struct *t, u32 cs_flags)&lt;br /&gt;
{&lt;br /&gt;
	u32 flags, event_mask;&lt;br /&gt;
	int ret;&lt;br /&gt;
&lt;br /&gt;
	/* Get thread flags. */&lt;br /&gt;
	ret = get_user(flags, &amp;amp;t-&amp;gt;rseq-&amp;gt;flags);&lt;br /&gt;
	if (ret)&lt;br /&gt;
		return ret;&lt;br /&gt;
&lt;br /&gt;
	/* Take critical section flags into account. */&lt;br /&gt;
	flags |= cs_flags; // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; here we have flags combined from struct rseq + struct rseq_cs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; value is zero. In this case, the rseq CS will be interrupted (and IP will be fixed up to the abort handler)&lt;br /&gt;
if preemption, migration, or signal occurs. But there are situations when users may want not to abort section once one of these events happen.&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; can be used only in combination with &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/*&lt;br /&gt;
	 * Restart on signal can only be inhibited when restart on&lt;br /&gt;
	 * preempt and restart on migrate are inhibited too. Otherwise,&lt;br /&gt;
	 * a preempted signal handler could fail to restart the prior&lt;br /&gt;
	 * execution context on sigreturn.&lt;br /&gt;
	 */&lt;br /&gt;
	if (unlikely((flags &amp;amp; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL) &amp;amp;&amp;amp;&lt;br /&gt;
		     (flags &amp;amp; RSEQ_CS_PREEMPT_MIGRATE_FLAGS) !=&lt;br /&gt;
		     RSEQ_CS_PREEMPT_MIGRATE_FLAGS))&lt;br /&gt;
		return -EINVAL;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How CRIU handles rseq ==&lt;br /&gt;
&lt;br /&gt;
CRIU handles the rseq differently depending on the particular case. Let's classify and cover all of them.&lt;br /&gt;
&lt;br /&gt;
# the process is not inside the rseq critical section&lt;br /&gt;
# the process is inside the rseq CS&lt;br /&gt;
## &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== the process is not inside the rseq critical section ===&lt;br /&gt;
&lt;br /&gt;
Simplest case. Process just have &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; registered in the kernel but currently instruction pointer (IP) not inside CS.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
We need only to determine where the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; is and dump its address length and signature.&lt;br /&gt;
To achieve that we use special ptrace handle &amp;lt;code&amp;gt;PTRACE_GET_RSEQ_CONFIGURATION&amp;lt;/code&amp;gt; (refer to the &amp;lt;code&amp;gt;dump_thread_rseq&amp;lt;/code&amp;gt; function).&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
We need to take data about the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; from the image (see images/rseq.proto) and register it from the parasite context using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall (take a look on &amp;lt;code&amp;gt;restore_rseq&amp;lt;/code&amp;gt; in criu/pie/restorer.c)&lt;br /&gt;
&lt;br /&gt;
=== inside CS: &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The process was caught with IP inside CS. Can we act as before? So, dump &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; address, restore it, and so on. No, we can't.&lt;br /&gt;
The reason is that CRIU saves IP as it was during the dump. But the rseq semantic is to jump to abort handler if CS execution was interrupted.&lt;br /&gt;
In this particular case we have &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; equal to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;&lt;br /&gt;
it means that if CS will be interrupted by the preeption, migration (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;) or migration (&amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt;) or preemption (&amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;)&lt;br /&gt;
the kernel will fixup IP of the process to the abort handler address.&lt;br /&gt;
&lt;br /&gt;
When we dump the process using CRIU it will just save IP as it was and restore it. That's a serious problem and this may break the user application (even cause crash!).&lt;br /&gt;
&lt;br /&gt;
Lets see &amp;lt;code&amp;gt;fixup_thread_rseq&amp;lt;/code&amp;gt; function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	if (task_in_rseq(rseq_cs, TI_IP(core))) {&lt;br /&gt;
		struct pid *tid = &amp;amp;item-&amp;gt;threads[i];&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
		pr_warn(&amp;quot;The %d task is in rseq critical section. IP will be set to rseq abort handler addr\n&amp;quot;,&lt;br /&gt;
				tid-&amp;gt;real);&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
		if (!(rseq_cs-&amp;gt;flags &amp;amp; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL)) {&lt;br /&gt;
			pr_warn(&amp;quot;The %d task is in rseq critical section. IP will be set to rseq abort handler addr\n&amp;quot;,&lt;br /&gt;
				tid-&amp;gt;real);&lt;br /&gt;
&lt;br /&gt;
			TI_IP(core) = rseq_cs-&amp;gt;abort_ip;&lt;br /&gt;
&lt;br /&gt;
			if (item-&amp;gt;pid-&amp;gt;real == tid-&amp;gt;real) {&lt;br /&gt;
				compel_set_leader_ip(dmpi(item)-&amp;gt;parasite_ctl, rseq_cs-&amp;gt;abort_ip);&lt;br /&gt;
			} else {&lt;br /&gt;
				compel_set_thread_ip(dmpi(item)-&amp;gt;thread_ctls[i], rseq_cs-&amp;gt;abort_ip);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It checks that process IP inside CS and fixes it up to the abort handler IP as the kernel does.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
We need to determine where the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; is and dump its address length and signature.&lt;br /&gt;
To achieve that we use special ptrace handle &amp;lt;code&amp;gt;PTRACE_GET_RSEQ_CONFIGURATION&amp;lt;/code&amp;gt; (refer to the &amp;lt;code&amp;gt;dump_thread_rseq&amp;lt;/code&amp;gt; function).&lt;br /&gt;
&lt;br /&gt;
We have to fix up IP to the abort handler.&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
We need to take data about the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; from the image (see images/rseq.proto) and register it from the parasite context using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall (take a look on &amp;lt;code&amp;gt;restore_rseq&amp;lt;/code&amp;gt; in criu/pie/restorer.c)&lt;br /&gt;
&lt;br /&gt;
No additional actions here. The process will be restored and will continue execution from the abort handler (not within the rseq CS!).&lt;br /&gt;
&lt;br /&gt;
=== inside CS: &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Rare case, but we support it too. If the rseq CS has &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; flag it means that its technically&lt;br /&gt;
non-abortable. So, from the first glance, it seems like we can just not do anything special: save rseq structure address, not fix up IP.&lt;br /&gt;
This is incorrect.&lt;br /&gt;
&lt;br /&gt;
The kernel will clean up &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; pointer once we jump into the parasite on the dump:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static int rseq_ip_fixup(struct pt_regs *regs)&lt;br /&gt;
{&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
	/*&lt;br /&gt;
	 * Handle potentially not being within a critical section.&lt;br /&gt;
	 * If not nested over a rseq critical section, restart is useless.&lt;br /&gt;
	 * Clear the rseq_cs pointer and return.&lt;br /&gt;
	 */&lt;br /&gt;
	if (!in_rseq_cs(ip, &amp;amp;rseq_cs))&lt;br /&gt;
		return clear_rseq_cs(t);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and after the restore process will continue the rseq CS execution from the same place (it's okay) but from the kernel point of view,&lt;br /&gt;
the process will continue this execution as not being within the rseq CS (that's bad!). Because the kernel determines execution context from the &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
We need to determine where the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; is and dump its address length and signature.&lt;br /&gt;
To achieve that we use special ptrace handle &amp;lt;code&amp;gt;PTRACE_GET_RSEQ_CONFIGURATION&amp;lt;/code&amp;gt; (refer to the &amp;lt;code&amp;gt;dump_thread_rseq&amp;lt;/code&amp;gt; function).&lt;br /&gt;
&lt;br /&gt;
We save IP as it was (not doing fixup), but we have to save &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field into the CRIU image.&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
We need to take data about the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; from the image (see images/rseq.proto) and register it from the parasite context using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall (take a look on &amp;lt;code&amp;gt;restore_rseq&amp;lt;/code&amp;gt; in criu/pie/restorer.c)&lt;br /&gt;
&lt;br /&gt;
We need to restore &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; memory externaly using ptrace &amp;lt;code&amp;gt;POKEAREA&amp;lt;/code&amp;gt; (see &amp;lt;code&amp;gt;restore_rseq_cs&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
* tests for all architectures (right now we have ZDTM tests only for x86_64)&lt;br /&gt;
* improvement support of built-in rseq for non-Glibc libraries&lt;br /&gt;
* pre-dump tests (?)&lt;br /&gt;
* leave-running tests (?)&lt;br /&gt;
* crfail test&lt;br /&gt;
* threaded test&lt;br /&gt;
&lt;br /&gt;
== Useful links ==&lt;br /&gt;
&lt;br /&gt;
* [1] https://github.com/torvalds/linux/blob/b2d229d4ddb17db541098b83524d901257e93845/kernel/rseq.c#L1&lt;br /&gt;
* [2] https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/&lt;br /&gt;
* [3] https://lwn.net/Articles/883104/&lt;br /&gt;
* [4] https://patchwork.sourceware.org/project/glibc/list/?series=5530&amp;amp;state=*&lt;br /&gt;
&lt;br /&gt;
[[Category: Under the hood]]&lt;br /&gt;
[[Category: Editor help needed]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5264</id>
		<title>Restartable Sequences</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5264"/>
		<updated>2022-04-18T12:41:57Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;Restartable sequences&amp;quot; (&amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt;) are small segments of user-space code designed to access per-CPU data structures without the need for heavyweight locking.&lt;br /&gt;
rseq is supported since Linux kernel 4.18 [1]&lt;br /&gt;
&lt;br /&gt;
I strongly suggest reading the article [https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/ Linux restartable sequences] before this one.&lt;br /&gt;
&lt;br /&gt;
== Linux kernel interface ==&lt;br /&gt;
&lt;br /&gt;
The Linux kernel interface for rseq is fairly simple. It's just &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall:&lt;br /&gt;
&amp;lt;code&amp;gt;sys_rseq(struct rseq *rseq, uint32_t rseq_len, int flags, uint32_t sig)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum rseq_cs_flags {&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct rseq_cs {&lt;br /&gt;
	__u32 version; /* always 0 at this moment */&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
	void *start_ip;&lt;br /&gt;
	/* Offset from start_ip. */&lt;br /&gt;
	intptr_t post_commit_offset;&lt;br /&gt;
	void *abort_ip;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
struct rseq {&lt;br /&gt;
	__u32 cpu_id_start;&lt;br /&gt;
	__u32 cpu_id;&lt;br /&gt;
	struct rseq_cs *rseq_cs;&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the userspace side, we need to keep &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; somewhere and register it on the kernel side using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall.&lt;br /&gt;
Then, once we want to execute some code as a rseq critical section (&amp;lt;code&amp;gt;rseq cs&amp;lt;/code&amp;gt; or just CS) we need to allocate and fill with the data&lt;br /&gt;
&amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt;. We have to specify the start address of our CS, and the address of the abort handler (called when CS was interrupted by a preemption, migration&lt;br /&gt;
or signal). Then we need to put an pointer to &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
== What about &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
You may have noticed that both &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; have &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; field. It may took values from &amp;lt;code&amp;gt;enum rseq_cs_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First of all, a user may specify flags in any place they will be combined on the kernel side:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static int rseq_need_restart(struct task_struct *t, u32 cs_flags)&lt;br /&gt;
{&lt;br /&gt;
	u32 flags, event_mask;&lt;br /&gt;
	int ret;&lt;br /&gt;
&lt;br /&gt;
	/* Get thread flags. */&lt;br /&gt;
	ret = get_user(flags, &amp;amp;t-&amp;gt;rseq-&amp;gt;flags);&lt;br /&gt;
	if (ret)&lt;br /&gt;
		return ret;&lt;br /&gt;
&lt;br /&gt;
	/* Take critical section flags into account. */&lt;br /&gt;
	flags |= cs_flags; // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; here we have flags combined from struct rseq + struct rseq_cs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; value is zero. In this case, the rseq CS will be interrupted (and IP will be fixed up to the abort handler)&lt;br /&gt;
if preemption, migration, or signal occurs. But there are situations when users may want not to abort section once one of these events happen.&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; can be used only in combination with &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/*&lt;br /&gt;
	 * Restart on signal can only be inhibited when restart on&lt;br /&gt;
	 * preempt and restart on migrate are inhibited too. Otherwise,&lt;br /&gt;
	 * a preempted signal handler could fail to restart the prior&lt;br /&gt;
	 * execution context on sigreturn.&lt;br /&gt;
	 */&lt;br /&gt;
	if (unlikely((flags &amp;amp; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL) &amp;amp;&amp;amp;&lt;br /&gt;
		     (flags &amp;amp; RSEQ_CS_PREEMPT_MIGRATE_FLAGS) !=&lt;br /&gt;
		     RSEQ_CS_PREEMPT_MIGRATE_FLAGS))&lt;br /&gt;
		return -EINVAL;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How CRIU handles rseq ==&lt;br /&gt;
&lt;br /&gt;
CRIU handles the rseq differently depending on the particular case. Let's classify and cover all of them.&lt;br /&gt;
&lt;br /&gt;
# the process is not inside the rseq critical section&lt;br /&gt;
# the process is inside the rseq CS&lt;br /&gt;
## &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== the process is not inside the rseq critical section ===&lt;br /&gt;
&lt;br /&gt;
Simplest case. Process just have &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; registered in the kernel but currently instruction pointer (IP) not inside CS.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
We need only to determine where the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; is and dump its address length and signature.&lt;br /&gt;
To achieve that we use special ptrace handle &amp;lt;code&amp;gt;PTRACE_GET_RSEQ_CONFIGURATION&amp;lt;/code&amp;gt; (refer to the &amp;lt;code&amp;gt;dump_thread_rseq&amp;lt;/code&amp;gt; function).&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
We need to take data about the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; from the image (see images/rseq.proto) and register it from the parasite context using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall (take a look on &amp;lt;code&amp;gt;restore_rseq&amp;lt;/code&amp;gt; in criu/pie/restorer.c)&lt;br /&gt;
&lt;br /&gt;
=== inside CS: &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The process was caught with IP inside CS. Can we act as before? So, dump &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; address, restore it, and so on. No, we can't.&lt;br /&gt;
The reason is that CRIU saves IP as it was during the dump. But the rseq semantic is to jump to abort handler if CS execution was interrupted.&lt;br /&gt;
In this particular case we have &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; equal to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;&lt;br /&gt;
it means that if CS will be interrupted by the preeption, migration (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;) or migration (&amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt;) or preemption (&amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;)&lt;br /&gt;
the kernel will fixup IP of the process to the abort handler address.&lt;br /&gt;
&lt;br /&gt;
When we dump the process using CRIU it will just save IP as it was and restore it. That's a serious problem and this may break the user application (even cause crash!).&lt;br /&gt;
&lt;br /&gt;
Lets see &amp;lt;code&amp;gt;fixup_thread_rseq&amp;lt;/code&amp;gt; function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	if (task_in_rseq(rseq_cs, TI_IP(core))) {&lt;br /&gt;
		struct pid *tid = &amp;amp;item-&amp;gt;threads[i];&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
		pr_warn(&amp;quot;The %d task is in rseq critical section. IP will be set to rseq abort handler addr\n&amp;quot;,&lt;br /&gt;
				tid-&amp;gt;real);&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
		if (!(rseq_cs-&amp;gt;flags &amp;amp; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL)) {&lt;br /&gt;
			pr_warn(&amp;quot;The %d task is in rseq critical section. IP will be set to rseq abort handler addr\n&amp;quot;,&lt;br /&gt;
				tid-&amp;gt;real);&lt;br /&gt;
&lt;br /&gt;
			TI_IP(core) = rseq_cs-&amp;gt;abort_ip;&lt;br /&gt;
&lt;br /&gt;
			if (item-&amp;gt;pid-&amp;gt;real == tid-&amp;gt;real) {&lt;br /&gt;
				compel_set_leader_ip(dmpi(item)-&amp;gt;parasite_ctl, rseq_cs-&amp;gt;abort_ip);&lt;br /&gt;
			} else {&lt;br /&gt;
				compel_set_thread_ip(dmpi(item)-&amp;gt;thread_ctls[i], rseq_cs-&amp;gt;abort_ip);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It checks that process IP inside CS and fixes it up to the abort handler IP as the kernel does.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
We need to determine where the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; is and dump its address length and signature.&lt;br /&gt;
To achieve that we use special ptrace handle &amp;lt;code&amp;gt;PTRACE_GET_RSEQ_CONFIGURATION&amp;lt;/code&amp;gt; (refer to the &amp;lt;code&amp;gt;dump_thread_rseq&amp;lt;/code&amp;gt; function).&lt;br /&gt;
&lt;br /&gt;
We have to fix up IP to the abort handler.&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
We need to take data about the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; from the image (see images/rseq.proto) and register it from the parasite context using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall (take a look on &amp;lt;code&amp;gt;restore_rseq&amp;lt;/code&amp;gt; in criu/pie/restorer.c)&lt;br /&gt;
&lt;br /&gt;
No additional actions here. The process will be restored and will continue execution from the abort handler (not within the rseq CS!).&lt;br /&gt;
&lt;br /&gt;
=== inside CS: &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Rare case, but we support it too. If the rseq CS has &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; flag it means that its technically&lt;br /&gt;
non-abortable. So, from the first glance, it seems like we can just not do anything special: save rseq structure address, not fix up IP.&lt;br /&gt;
This is incorrect.&lt;br /&gt;
&lt;br /&gt;
The kernel will clean up &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; pointer once we jump into the parasite on the dump:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static int rseq_ip_fixup(struct pt_regs *regs)&lt;br /&gt;
{&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
	/*&lt;br /&gt;
	 * Handle potentially not being within a critical section.&lt;br /&gt;
	 * If not nested over a rseq critical section, restart is useless.&lt;br /&gt;
	 * Clear the rseq_cs pointer and return.&lt;br /&gt;
	 */&lt;br /&gt;
	if (!in_rseq_cs(ip, &amp;amp;rseq_cs))&lt;br /&gt;
		return clear_rseq_cs(t);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and after the restore process will continue the rseq CS execution from the same place (it's okay) but from the kernel point of view,&lt;br /&gt;
the process will continue this execution as not being within the rseq CS (that's bad!). Because the kernel determines execution context from the &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
We need to determine where the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; is and dump its address length and signature.&lt;br /&gt;
To achieve that we use special ptrace handle &amp;lt;code&amp;gt;PTRACE_GET_RSEQ_CONFIGURATION&amp;lt;/code&amp;gt; (refer to the &amp;lt;code&amp;gt;dump_thread_rseq&amp;lt;/code&amp;gt; function).&lt;br /&gt;
&lt;br /&gt;
We save IP as it was (not doing fixup), but we have to save &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field into the CRIU image.&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
We need to take data about the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; from the image (see images/rseq.proto) and register it from the parasite context using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall (take a look on &amp;lt;code&amp;gt;restore_rseq&amp;lt;/code&amp;gt; in criu/pie/restorer.c)&lt;br /&gt;
&lt;br /&gt;
We need to restore &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; memory externaly using ptrace &amp;lt;code&amp;gt;POKEAREA&amp;lt;/code&amp;gt; (see &amp;lt;code&amp;gt;restore_rseq_cs&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
* tests for all architectures (right now we have ZDTM tests only for x86_64)&lt;br /&gt;
* improvement support of built-in rseq for non-Glibc libraries&lt;br /&gt;
* pre-dump tests (?)&lt;br /&gt;
* leave-running tests (?)&lt;br /&gt;
* crfail test&lt;br /&gt;
* threaded test&lt;br /&gt;
&lt;br /&gt;
== Useful links ==&lt;br /&gt;
&lt;br /&gt;
* [1] https://github.com/torvalds/linux/blob/b2d229d4ddb17db541098b83524d901257e93845/kernel/rseq.c#L1&lt;br /&gt;
* [2] https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/&lt;br /&gt;
* [3] https://lwn.net/Articles/883104/&lt;br /&gt;
&lt;br /&gt;
[[Category: Under the hood]]&lt;br /&gt;
[[Category: Editor help needed]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5263</id>
		<title>Restartable Sequences</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5263"/>
		<updated>2022-04-18T12:22:09Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;Restartable sequences&amp;quot; (&amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt;) are small segments of user-space code designed to access per-CPU data structures without the need for heavyweight locking.&lt;br /&gt;
rseq is supported since Linux kernel 4.18 [1]&lt;br /&gt;
&lt;br /&gt;
I strongly suggest reading the article [https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/ Linux restartable sequences] before this one.&lt;br /&gt;
&lt;br /&gt;
== Linux kernel interface ==&lt;br /&gt;
&lt;br /&gt;
The Linux kernel interface for rseq is fairly simple. It's just &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall:&lt;br /&gt;
&amp;lt;code&amp;gt;sys_rseq(struct rseq *rseq, uint32_t rseq_len, int flags, uint32_t sig)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum rseq_cs_flags {&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct rseq_cs {&lt;br /&gt;
	__u32 version; /* always 0 at this moment */&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
	void *start_ip;&lt;br /&gt;
	/* Offset from start_ip. */&lt;br /&gt;
	intptr_t post_commit_offset;&lt;br /&gt;
	void *abort_ip;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
struct rseq {&lt;br /&gt;
	__u32 cpu_id_start;&lt;br /&gt;
	__u32 cpu_id;&lt;br /&gt;
	struct rseq_cs *rseq_cs;&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the userspace side, we need to keep &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; somewhere and register it on the kernel side using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall.&lt;br /&gt;
Then, once we want to execute some code as a rseq critical section (&amp;lt;code&amp;gt;rseq cs&amp;lt;/code&amp;gt; or just CS) we need to allocate and fill with the data&lt;br /&gt;
&amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt;. We have to specify the start address of our CS, and the address of the abort handler (called when CS was interrupted by a preemption, migration&lt;br /&gt;
or signal). Then we need to put an pointer to &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
== What about &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
You may have noticed that both &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; have &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; field. It may took values from &amp;lt;code&amp;gt;enum rseq_cs_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First of all, a user may specify flags in any place they will be combined on the kernel side:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static int rseq_need_restart(struct task_struct *t, u32 cs_flags)&lt;br /&gt;
{&lt;br /&gt;
	u32 flags, event_mask;&lt;br /&gt;
	int ret;&lt;br /&gt;
&lt;br /&gt;
	/* Get thread flags. */&lt;br /&gt;
	ret = get_user(flags, &amp;amp;t-&amp;gt;rseq-&amp;gt;flags);&lt;br /&gt;
	if (ret)&lt;br /&gt;
		return ret;&lt;br /&gt;
&lt;br /&gt;
	/* Take critical section flags into account. */&lt;br /&gt;
	flags |= cs_flags; // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; here we have flags combined from struct rseq + struct rseq_cs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; value is zero. In this case, the rseq CS will be interrupted (and IP will be fixed up to the abort handler)&lt;br /&gt;
if preemption, migration, or signal occurs. But there are situations when users may want not to abort section once one of these events happen.&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; can be used only in combination with &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/*&lt;br /&gt;
	 * Restart on signal can only be inhibited when restart on&lt;br /&gt;
	 * preempt and restart on migrate are inhibited too. Otherwise,&lt;br /&gt;
	 * a preempted signal handler could fail to restart the prior&lt;br /&gt;
	 * execution context on sigreturn.&lt;br /&gt;
	 */&lt;br /&gt;
	if (unlikely((flags &amp;amp; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL) &amp;amp;&amp;amp;&lt;br /&gt;
		     (flags &amp;amp; RSEQ_CS_PREEMPT_MIGRATE_FLAGS) !=&lt;br /&gt;
		     RSEQ_CS_PREEMPT_MIGRATE_FLAGS))&lt;br /&gt;
		return -EINVAL;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How CRIU handles rseq ==&lt;br /&gt;
&lt;br /&gt;
CRIU handles the rseq differently depending on the particular case. Let's classify and cover all of them.&lt;br /&gt;
&lt;br /&gt;
# the process is not inside the rseq critical section&lt;br /&gt;
# the process is inside the rseq CS&lt;br /&gt;
## &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== the process is not inside the rseq critical section ===&lt;br /&gt;
&lt;br /&gt;
Simplest case. Process just have &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; registered in the kernel but currently instruction pointer (IP) not inside CS.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
We need only to determine where the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; is and dump its address length and signature.&lt;br /&gt;
To achieve that we use special ptrace handle &amp;lt;code&amp;gt;PTRACE_GET_RSEQ_CONFIGURATION&amp;lt;/code&amp;gt; (refer to the &amp;lt;code&amp;gt;dump_thread_rseq&amp;lt;/code&amp;gt; function).&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
We need to take data about the &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; from the image (see images/rseq.proto) and register it from the parasite context using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall (take a look on &amp;lt;code&amp;gt;restore_rseq&amp;lt;/code&amp;gt; in criu/pie/restorer.c)&lt;br /&gt;
&lt;br /&gt;
=== inside CS: &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The process was caught with IP inside CS. Can we act as before? So, dump &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; address, restore it, and so on. No, we can't.&lt;br /&gt;
The reason is that CRIU saves IP as it was during the dump. But the rseq semantic is to jump to abort handler if CS execution was interrupted.&lt;br /&gt;
In this particular case we have &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; equal to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;&lt;br /&gt;
it means that if CS will be interrupted by the preeption, migration (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;) or migration (&amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt;) or preemption (&amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;)&lt;br /&gt;
the kernel will fixup IP of the process to the abort handler address.&lt;br /&gt;
&lt;br /&gt;
When we dump the process using CRIU it will just save IP as it was and restore it. That's a serious problem and this may break the user application (even cause crash!).&lt;br /&gt;
&lt;br /&gt;
Lets see &amp;lt;code&amp;gt;fixup_thread_rseq&amp;lt;/code&amp;gt; function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	if (task_in_rseq(rseq_cs, TI_IP(core))) {&lt;br /&gt;
		struct pid *tid = &amp;amp;item-&amp;gt;threads[i];&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
		pr_warn(&amp;quot;The %d task is in rseq critical section. IP will be set to rseq abort handler addr\n&amp;quot;,&lt;br /&gt;
				tid-&amp;gt;real);&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
		if (!(rseq_cs-&amp;gt;flags &amp;amp; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL)) {&lt;br /&gt;
			pr_warn(&amp;quot;The %d task is in rseq critical section. IP will be set to rseq abort handler addr\n&amp;quot;,&lt;br /&gt;
				tid-&amp;gt;real);&lt;br /&gt;
&lt;br /&gt;
			TI_IP(core) = rseq_cs-&amp;gt;abort_ip;&lt;br /&gt;
&lt;br /&gt;
			if (item-&amp;gt;pid-&amp;gt;real == tid-&amp;gt;real) {&lt;br /&gt;
				compel_set_leader_ip(dmpi(item)-&amp;gt;parasite_ctl, rseq_cs-&amp;gt;abort_ip);&lt;br /&gt;
			} else {&lt;br /&gt;
				compel_set_thread_ip(dmpi(item)-&amp;gt;thread_ctls[i], rseq_cs-&amp;gt;abort_ip);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It checks that process IP inside CS and fixes it up to the abort handler IP as the kernel does.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== inside CS: &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Rare case, but we support it too.&lt;br /&gt;
&lt;br /&gt;
==== Dump ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Restore ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
* tests for all architectures (right now we have ZDTM tests only for x86_64)&lt;br /&gt;
* improvement support of built-in rseq for non-Glibc libraries&lt;br /&gt;
* pre-dump tests (?)&lt;br /&gt;
* leave-running tests (?)&lt;br /&gt;
* crfail test&lt;br /&gt;
* threaded test&lt;br /&gt;
&lt;br /&gt;
== Useful links ==&lt;br /&gt;
&lt;br /&gt;
* [1] https://github.com/torvalds/linux/blob/b2d229d4ddb17db541098b83524d901257e93845/kernel/rseq.c#L1&lt;br /&gt;
* [2] https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/&lt;br /&gt;
* [3] https://lwn.net/Articles/883104/&lt;br /&gt;
&lt;br /&gt;
[[Category: Under the hood]]&lt;br /&gt;
[[Category: Editor help needed]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5262</id>
		<title>Restartable Sequences</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5262"/>
		<updated>2022-04-18T08:26:48Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;Restartable sequences&amp;quot; (&amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt;) are small segments of user-space code designed to access per-CPU data structures without the need for heavyweight locking.&lt;br /&gt;
rseq is supported since Linux kernel 4.18 [1]&lt;br /&gt;
&lt;br /&gt;
I strongly suggest reading the article [https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/ Linux restartable sequences] before this one.&lt;br /&gt;
&lt;br /&gt;
== Linux kernel interface ==&lt;br /&gt;
&lt;br /&gt;
The Linux kernel interface for rseq is fairly simple. It's just &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall:&lt;br /&gt;
&amp;lt;code&amp;gt;sys_rseq(struct rseq *rseq, uint32_t rseq_len, int flags, uint32_t sig)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum rseq_cs_flags {&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct rseq_cs {&lt;br /&gt;
	__u32 version; /* always 0 at this moment */&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
	void *start_ip;&lt;br /&gt;
	/* Offset from start_ip. */&lt;br /&gt;
	intptr_t post_commit_offset;&lt;br /&gt;
	void *abort_ip;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
struct rseq {&lt;br /&gt;
	__u32 cpu_id_start;&lt;br /&gt;
	__u32 cpu_id;&lt;br /&gt;
	struct rseq_cs *rseq_cs;&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the userspace side, we need to keep &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; somewhere and register it on the kernel side using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall.&lt;br /&gt;
Then, once we want to execute some code as a rseq critical section (&amp;lt;code&amp;gt;rseq cs&amp;lt;/code&amp;gt; or just CS) we need to allocate and fill with the data&lt;br /&gt;
&amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt;. We have to specify the start address of our CS, and the address of the abort handler (called when CS was interrupted by a preemption, migration&lt;br /&gt;
or signal). Then we need to put an pointer to &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
== What about &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
You may have noticed that both &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; have &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; field. It may took values from &amp;lt;code&amp;gt;enum rseq_cs_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First of all, a user may specify flags in any place they will be combined on the kernel side:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static int rseq_need_restart(struct task_struct *t, u32 cs_flags)&lt;br /&gt;
{&lt;br /&gt;
	u32 flags, event_mask;&lt;br /&gt;
	int ret;&lt;br /&gt;
&lt;br /&gt;
	/* Get thread flags. */&lt;br /&gt;
	ret = get_user(flags, &amp;amp;t-&amp;gt;rseq-&amp;gt;flags);&lt;br /&gt;
	if (ret)&lt;br /&gt;
		return ret;&lt;br /&gt;
&lt;br /&gt;
	/* Take critical section flags into account. */&lt;br /&gt;
	flags |= cs_flags; // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; here we have flags combined from struct rseq + struct rseq_cs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; value is zero. In this case, the rseq CS will be interrupted (and IP will be fixed up to the abort handler)&lt;br /&gt;
if preemption, migration, or signal occurs. But there are situations when users may want not to abort section once one of these events happen.&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; can be used only in combination with &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/*&lt;br /&gt;
	 * Restart on signal can only be inhibited when restart on&lt;br /&gt;
	 * preempt and restart on migrate are inhibited too. Otherwise,&lt;br /&gt;
	 * a preempted signal handler could fail to restart the prior&lt;br /&gt;
	 * execution context on sigreturn.&lt;br /&gt;
	 */&lt;br /&gt;
	if (unlikely((flags &amp;amp; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL) &amp;amp;&amp;amp;&lt;br /&gt;
		     (flags &amp;amp; RSEQ_CS_PREEMPT_MIGRATE_FLAGS) !=&lt;br /&gt;
		     RSEQ_CS_PREEMPT_MIGRATE_FLAGS))&lt;br /&gt;
		return -EINVAL;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Useful links ==&lt;br /&gt;
&lt;br /&gt;
* [1] https://github.com/torvalds/linux/blob/b2d229d4ddb17db541098b83524d901257e93845/kernel/rseq.c#L1&lt;br /&gt;
* [2] https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/&lt;br /&gt;
* [3] https://lwn.net/Articles/883104/&lt;br /&gt;
&lt;br /&gt;
[[Category: Under the hood]]&lt;br /&gt;
[[Category: Editor help needed]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5261</id>
		<title>Restartable Sequences</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Restartable_Sequences&amp;diff=5261"/>
		<updated>2022-04-18T08:21:31Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: draft of the article about rseq support in CRIU&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;Restartable sequences&amp;quot; (&amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt;) are small segments of user-space code designed to access per-CPU data structures without the need for heavyweight locking.&lt;br /&gt;
rseq is supported since Linux kernel 4.18 [1]&lt;br /&gt;
&lt;br /&gt;
== Linux kernel interface ==&lt;br /&gt;
&lt;br /&gt;
The Linux kernel interface for rseq is fairly simple. It's just &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall:&lt;br /&gt;
&amp;lt;code&amp;gt;sys_rseq(struct rseq *rseq, uint32_t rseq_len, int flags, uint32_t sig)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum rseq_cs_flags {&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),&lt;br /&gt;
	RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE = (1U &amp;lt;&amp;lt; RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct rseq_cs {&lt;br /&gt;
	__u32 version; /* always 0 at this moment */&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
	void *start_ip;&lt;br /&gt;
	/* Offset from start_ip. */&lt;br /&gt;
	intptr_t post_commit_offset;&lt;br /&gt;
	void *abort_ip;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
struct rseq {&lt;br /&gt;
	__u32 cpu_id_start;&lt;br /&gt;
	__u32 cpu_id;&lt;br /&gt;
	struct rseq_cs *rseq_cs;&lt;br /&gt;
	enum rseq_cs_flags flags;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the userspace side, we need to keep &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; somewhere and register it on the kernel side using the &amp;lt;code&amp;gt;rseq&amp;lt;/code&amp;gt; syscall.&lt;br /&gt;
Then, once we want to execute some code as a rseq critical section (&amp;lt;code&amp;gt;rseq cs&amp;lt;/code&amp;gt; or just CS) we need to allocate and fill with the data&lt;br /&gt;
&amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt;. We have to specify the start address of our CS, and the address of the abort handler (called when CS was interrupted by a preemption, migration&lt;br /&gt;
or signal). Then we need to put an pointer to &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;(struct rseq).rseq_cs&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
== What about &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
You may have noticed that both &amp;lt;code&amp;gt;struct rseq&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;struct rseq_cs&amp;lt;/code&amp;gt; have &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; field. It may took values from &amp;lt;code&amp;gt;enum rseq_cs_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First of all, a user may specify flags in any place they will be combined on the kernel side:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static int rseq_need_restart(struct task_struct *t, u32 cs_flags)&lt;br /&gt;
{&lt;br /&gt;
	u32 flags, event_mask;&lt;br /&gt;
	int ret;&lt;br /&gt;
&lt;br /&gt;
	/* Get thread flags. */&lt;br /&gt;
	ret = get_user(flags, &amp;amp;t-&amp;gt;rseq-&amp;gt;flags);&lt;br /&gt;
	if (ret)&lt;br /&gt;
		return ret;&lt;br /&gt;
&lt;br /&gt;
	/* Take critical section flags into account. */&lt;br /&gt;
	flags |= cs_flags; // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; here we have flags combined from struct rseq + struct rseq_cs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common &amp;lt;code&amp;gt;flags&amp;lt;/code&amp;gt; value is zero. In this case, the rseq CS will be interrupted (and IP will be fixed up to the abort handler)&lt;br /&gt;
if preemption, migration, or signal occurs. But there are situations when users may want not to abort section once one of these events happen.&lt;br /&gt;
&lt;br /&gt;
It's worth mentioning that &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL&amp;lt;/code&amp;gt; can be used only in combination with &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/*&lt;br /&gt;
	 * Restart on signal can only be inhibited when restart on&lt;br /&gt;
	 * preempt and restart on migrate are inhibited too. Otherwise,&lt;br /&gt;
	 * a preempted signal handler could fail to restart the prior&lt;br /&gt;
	 * execution context on sigreturn.&lt;br /&gt;
	 */&lt;br /&gt;
	if (unlikely((flags &amp;amp; RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL) &amp;amp;&amp;amp;&lt;br /&gt;
		     (flags &amp;amp; RSEQ_CS_PREEMPT_MIGRATE_FLAGS) !=&lt;br /&gt;
		     RSEQ_CS_PREEMPT_MIGRATE_FLAGS))&lt;br /&gt;
		return -EINVAL;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Useful links ==&lt;br /&gt;
&lt;br /&gt;
* [1] https://github.com/torvalds/linux/blob/b2d229d4ddb17db541098b83524d901257e93845/kernel/rseq.c#L1&lt;br /&gt;
* [2] https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/&lt;br /&gt;
* [3] https://lwn.net/Articles/883104/&lt;br /&gt;
&lt;br /&gt;
[[Category: Under the hood]]&lt;br /&gt;
[[Category: Editor help needed]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5257</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5257"/>
		<updated>2022-04-05T21:11:40Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */ added memfd_secret project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Support sparse ghosts ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
When criu dumps processes it also dumps files that are opened by them. It does this by saving file names by which the files are accessible. But sometimes files can have no names. It may happen if a task opened a file and then removed it. To dump this file criu cannot save its name (because the name doesn't exist). Instead criu saves the whole file. This is called &amp;quot;ghost file&amp;quot;. Since saving the whole file is very expensive (copying lots of data on disk) criu limits the maximum size of a ghost file. The latter is also not good, because there are &amp;quot;sparse&amp;quot; files, that are large in size, but may be small from the real disk usage perspective. The goal of the task is to support sparse ghost files, i.e. limit the size of the ghost not by its length but by disk usage and when copying the data detect the used blocks and save only those.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
 &lt;br /&gt;
*[https://en.wikipedia.org/wiki/Sparse_file Sparse files]&lt;br /&gt;
*[[Dumping files]]&lt;br /&gt;
*[[Invisible files]]&lt;br /&gt;
*[https://www.kernel.org/doc/html/latest/filesystems/fiemap.html Fiemap ioctl]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian@brauner.io&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for memfd_secret file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of memfd_secret descriptors&lt;br /&gt;
&lt;br /&gt;
There is memfd_secret syscall which allows user to open&lt;br /&gt;
special memfd which is backed by special memory range which&lt;br /&gt;
is inaccessible by another processes (and the kernel too!).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have memfd_secret's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/865256/&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Mike Rapoport &amp;lt;mike.rapoport@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CGroup-v2 support ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' cgroup is a mechanism to organize processes hierarchically and distribute system resources along the hierarchy in a controlled and configurable manner. cgroup v2 is a new version of the cgroup file system. Unlike v1, cgroup v2 has only single hierarchy. CRIU has to dump/restore a container cgroup hierarchy along with all per-cgroup options. The cgroupv2 support in CRIU has to be compatible with Docker, containerd and cri-o.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CGroups]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/252&lt;br /&gt;
* https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dump shmem in user-mode (unprivileged-mode) ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses /proc/pid/map_files to dump and restore anonymous shared memory regions, but map_files is restricted to the global CAP_SYS_ADMIN capability. In most cases, it is possible to dump/restore shared memory region without map_files and we need to implement this in CRIU.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[User-mode]]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Porting crit functionalities in GO ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Implement image view and manipulation in Go&lt;br /&gt;
 &lt;br /&gt;
CRIU's checkpoint images are stored on disk using protobuf. For easier analysis of checkpoint files CRIU has a tool called [[CRIT|CRiu Image Tool (CRIT)]]. It can display/decode CRIU image files from binary protobuf to JSON as well as encode JSON files back to the binary format. With closer integration of CRIU in container runtimes it becomes important to be able to view the CRIU output files. Either for manipulation before restoring or for reading checkpoint statistics (memory pages written to disk, memory pages skipped, process downtime).&lt;br /&gt;
&lt;br /&gt;
Currently CRIT is implemented in Python, for easier integration in other Go projects it is important to have image manipulation and analysis available from GO. This means we need a Go based library to read/modify/write/encode/decode CRIU's image files. Based on this library a Go based implementation of CRIT would be useful.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CRIT]]&lt;br /&gt;
* Possible use case see LXD: https://github.com/lxc/lxd/blob/cb55b1c5a484a43e0c21c6ae8c4a2e30b4d45be3/lxd/migrate_container.go#L179&lt;br /&gt;
* https://github.com/lxc/lxd/pull/4072&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/tree/master/stats&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/pull/28&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt; / &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5256</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5256"/>
		<updated>2022-04-05T21:04:15Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Suspended project ideas */ move io_uring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Support sparse ghosts ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
When criu dumps processes it also dumps files that are opened by them. It does this by saving file names by which the files are accessible. But sometimes files can have no names. It may happen if a task opened a file and then removed it. To dump this file criu cannot save its name (because the name doesn't exist). Instead criu saves the whole file. This is called &amp;quot;ghost file&amp;quot;. Since saving the whole file is very expensive (copying lots of data on disk) criu limits the maximum size of a ghost file. The latter is also not good, because there are &amp;quot;sparse&amp;quot; files, that are large in size, but may be small from the real disk usage perspective. The goal of the task is to support sparse ghost files, i.e. limit the size of the ghost not by its length but by disk usage and when copying the data detect the used blocks and save only those.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
 &lt;br /&gt;
*[https://en.wikipedia.org/wiki/Sparse_file Sparse files]&lt;br /&gt;
*[[Dumping files]]&lt;br /&gt;
*[[Invisible files]]&lt;br /&gt;
*[https://www.kernel.org/doc/html/latest/filesystems/fiemap.html Fiemap ioctl]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian@brauner.io&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CGroup-v2 support ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' cgroup is a mechanism to organize processes hierarchically and distribute system resources along the hierarchy in a controlled and configurable manner. cgroup v2 is a new version of the cgroup file system. Unlike v1, cgroup v2 has only single hierarchy. CRIU has to dump/restore a container cgroup hierarchy along with all per-cgroup options. The cgroupv2 support in CRIU has to be compatible with Docker, containerd and cri-o.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CGroups]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/252&lt;br /&gt;
* https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dump shmem in user-mode (unprivileged-mode) ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses /proc/pid/map_files to dump and restore anonymous shared memory regions, but map_files is restricted to the global CAP_SYS_ADMIN capability. In most cases, it is possible to dump/restore shared memory region without map_files and we need to implement this in CRIU.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[User-mode]]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Porting crit functionalities in GO ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Implement image view and manipulation in Go&lt;br /&gt;
 &lt;br /&gt;
CRIU's checkpoint images are stored on disk using protobuf. For easier analysis of checkpoint files CRIU has a tool called [[CRIT|CRiu Image Tool (CRIT)]]. It can display/decode CRIU image files from binary protobuf to JSON as well as encode JSON files back to the binary format. With closer integration of CRIU in container runtimes it becomes important to be able to view the CRIU output files. Either for manipulation before restoring or for reading checkpoint statistics (memory pages written to disk, memory pages skipped, process downtime).&lt;br /&gt;
&lt;br /&gt;
Currently CRIT is implemented in Python, for easier integration in other Go projects it is important to have image manipulation and analysis available from GO. This means we need a Go based library to read/modify/write/encode/decode CRIU's image files. Based on this library a Go based implementation of CRIT would be useful.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CRIT]]&lt;br /&gt;
* Possible use case see LXD: https://github.com/lxc/lxd/blob/cb55b1c5a484a43e0c21c6ae8c4a2e30b4d45be3/lxd/migrate_container.go#L179&lt;br /&gt;
* https://github.com/lxc/lxd/pull/4072&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/tree/master/stats&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/pull/28&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt; / &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5255</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5255"/>
		<updated>2022-04-05T21:03:48Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */ remove io_uring as it's in progress by Kumar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Support sparse ghosts ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
When criu dumps processes it also dumps files that are opened by them. It does this by saving file names by which the files are accessible. But sometimes files can have no names. It may happen if a task opened a file and then removed it. To dump this file criu cannot save its name (because the name doesn't exist). Instead criu saves the whole file. This is called &amp;quot;ghost file&amp;quot;. Since saving the whole file is very expensive (copying lots of data on disk) criu limits the maximum size of a ghost file. The latter is also not good, because there are &amp;quot;sparse&amp;quot; files, that are large in size, but may be small from the real disk usage perspective. The goal of the task is to support sparse ghost files, i.e. limit the size of the ghost not by its length but by disk usage and when copying the data detect the used blocks and save only those.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
 &lt;br /&gt;
*[https://en.wikipedia.org/wiki/Sparse_file Sparse files]&lt;br /&gt;
*[[Dumping files]]&lt;br /&gt;
*[[Invisible files]]&lt;br /&gt;
*[https://www.kernel.org/doc/html/latest/filesystems/fiemap.html Fiemap ioctl]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian@brauner.io&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CGroup-v2 support ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' cgroup is a mechanism to organize processes hierarchically and distribute system resources along the hierarchy in a controlled and configurable manner. cgroup v2 is a new version of the cgroup file system. Unlike v1, cgroup v2 has only single hierarchy. CRIU has to dump/restore a container cgroup hierarchy along with all per-cgroup options. The cgroupv2 support in CRIU has to be compatible with Docker, containerd and cri-o.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CGroups]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/252&lt;br /&gt;
* https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dump shmem in user-mode (unprivileged-mode) ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses /proc/pid/map_files to dump and restore anonymous shared memory regions, but map_files is restricted to the global CAP_SYS_ADMIN capability. In most cases, it is possible to dump/restore shared memory region without map_files and we need to implement this in CRIU.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[User-mode]]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;ovzxemul@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Porting crit functionalities in GO ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Implement image view and manipulation in Go&lt;br /&gt;
 &lt;br /&gt;
CRIU's checkpoint images are stored on disk using protobuf. For easier analysis of checkpoint files CRIU has a tool called [[CRIT|CRiu Image Tool (CRIT)]]. It can display/decode CRIU image files from binary protobuf to JSON as well as encode JSON files back to the binary format. With closer integration of CRIU in container runtimes it becomes important to be able to view the CRIU output files. Either for manipulation before restoring or for reading checkpoint statistics (memory pages written to disk, memory pages skipped, process downtime).&lt;br /&gt;
&lt;br /&gt;
Currently CRIT is implemented in Python, for easier integration in other Go projects it is important to have image manipulation and analysis available from GO. This means we need a Go based library to read/modify/write/encode/decode CRIU's image files. Based on this library a Go based implementation of CRIT would be useful.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CRIT]]&lt;br /&gt;
* Possible use case see LXD: https://github.com/lxc/lxd/blob/cb55b1c5a484a43e0c21c6ae8c4a2e30b4d45be3/lxd/migrate_container.go#L179&lt;br /&gt;
* https://github.com/lxc/lxd/pull/4072&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/tree/master/stats&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/pull/28&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Expected size: 350 hours&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt; / &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5239</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5239"/>
		<updated>2022-02-21T09:09:39Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Support sparse ghosts ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
When criu dumps processes it also dumps files that are opened by them. It does this by saving file names by which the files are accessible. But sometimes files can have no names. It may happen if a task opened a file and then removed it. To dump this file criu cannot save its name (because the name doesn't exist). Instead criu saves the whole file. This is called &amp;quot;ghost file&amp;quot;. Since saving the whole file is very expensive (copying lots of data on disk) criu limits the maximum size of a ghost file. The latter is also not good, because there are &amp;quot;sparse&amp;quot; files, that are large in size, but may be small from the real disk usage perspective. The goal of the task is to support sparse ghost files, i.e. limit the size of the ghost not by its length but by disk usage and when copying the data detect the used blocks and save only those.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
 &lt;br /&gt;
*[https://en.wikipedia.org/wiki/Sparse_file Sparse files]&lt;br /&gt;
*[[Dumping files]]&lt;br /&gt;
*[[Invisible files]]&lt;br /&gt;
*[https://www.kernel.org/doc/html/latest/filesystems/fiemap.html Fiemap ioctl]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian@brauner.io&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CGroup-v2 support ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' cgroup is a mechanism to organize processes hierarchically and distribute system resources along the hierarchy in a controlled and configurable manner. cgroup v2 is a new version of the cgroup file system. Unlike v1, cgroup v2 has only single hierarchy. CRIU has to dump/restore a container cgroup hierarchy along with all per-cgroup options. The cgroupv2 support in CRIU has to be compatible with Docker, containerd and cri-o.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CGroups]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/252&lt;br /&gt;
* https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dump shmem in user-mode (unprivileged-mode) ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses /proc/pid/map_files to dump and restore anonymous shared memory regions, but map_files is restricted to the global CAP_SYS_ADMIN capability. In most cases, it is possible to dump/restore shared memory region without map_files and we need to implement this in CRIU.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[User-mode]]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Porting crit functionalities in GO ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Implement image view and manipulation in Go&lt;br /&gt;
 &lt;br /&gt;
CRIU's checkpoint images are stored on disk using protobuf. For easier analysis of checkpoint files CRIU has a tool called [[CRIT|CRiu Image Tool (CRIT)]]. It can display/decode CRIU image files from binary protobuf to JSON as well as encode JSON files back to the binary format. With closer integration of CRIU in container runtimes it becomes important to be able to view the CRIU output files. Either for manipulation before restoring or for reading checkpoint statistics (memory pages written to disk, memory pages skipped, process downtime).&lt;br /&gt;
&lt;br /&gt;
Currently CRIT is implemented in Python, for easier integration in other Go projects it is important to have image manipulation and analysis available from GO. This means we need a Go based library to read/modify/write/encode/decode CRIU's image files. Based on this library a Go based implementation of CRIT would be useful.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CRIT]]&lt;br /&gt;
* Possible use case see LXD: https://github.com/lxc/lxd/blob/cb55b1c5a484a43e0c21c6ae8c4a2e30b4d45be3/lxd/migrate_container.go#L179&lt;br /&gt;
* https://github.com/lxc/lxd/pull/4072&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/blob/master/phaul/stats.go&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/pull/28&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt; / &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5238</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5238"/>
		<updated>2022-02-21T08:46:03Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */ added project idea about pidfd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Support sparse ghosts ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
When criu dumps processes it also dumps files that are opened by them. It does this by saving file names by which the files are accessible. But sometimes files can have no names. It may happen if a task opened a file and then removed it. To dump this file criu cannot save its name (because the name doesn't exist). Instead criu saves the whole file. This is called &amp;quot;ghost file&amp;quot;. Since saving the whole file is very expensive (copying lots of data on disk) criu limits the maximum size of a ghost file. The latter is also not good, because there are &amp;quot;sparse&amp;quot; files, that are large in size, but may be small from the real disk usage perspective. The goal of the task is to support sparse ghost files, i.e. limit the size of the ghost not by its length but by disk usage and when copying the data detect the used blocks and save only those.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
 &lt;br /&gt;
*[https://en.wikipedia.org/wiki/Sparse_file Sparse files]&lt;br /&gt;
*[[Dumping files]]&lt;br /&gt;
*[[Invisible files]]&lt;br /&gt;
*[https://www.kernel.org/doc/html/latest/filesystems/fiemap.html Fiemap ioctl]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add support for pidfd file descriptors ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Support C/R of pidfd descriptors&lt;br /&gt;
&lt;br /&gt;
There is pidfd_open syscall which allows opening&lt;br /&gt;
a special PID file descriptor. A user can send a signal to&lt;br /&gt;
the process (pidfd_send_signal syscall), wait for the process&lt;br /&gt;
(poll() on pidfd).&lt;br /&gt;
&lt;br /&gt;
At the moment CRIU can't dump processes that have pidfd's opened.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://lwn.net/Articles/801319/&lt;br /&gt;
* https://lwn.net/Articles/794707/&lt;br /&gt;
* https://github.com/torvalds/linux/blob/v5.16/kernel/fork.c#L1877&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentors: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;, Christian Brauner &amp;lt;christian.brauner@ubuntu.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use eBPF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
* https://blog.zeyady.com/2021-08-16/gsoc-criu&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IOUring support ===&lt;br /&gt;
The io_uring Asynchronous I/O (AIO) framework is a new Linux I/O interface, first introduced in upstream Linux kernel version 5.1 (March 2019). It provides a low-latency and feature-rich interface for applications that require AIO functionality.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework&lt;br /&gt;
* https://github.com/axboe/liburing&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert (+linux kernel)&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CGroup-v2 support ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' cgroup is a mechanism to organize processes hierarchically and distribute system resources along the hierarchy in a controlled and configurable manner. cgroup v2 is a new version of the cgroup file system. Unlike v1, cgroup v2 has only single hierarchy. CRIU has to dump/restore a container cgroup hierarchy along with all per-cgroup options. The cgroupv2 support in CRIU has to be compatible with Docker, containerd and cri-o.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CGroups]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/252&lt;br /&gt;
* https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dump shmem in user-mode (unprivileged-mode) ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses /proc/pid/map_files to dump and restore anonymous shared memory regions, but map_files is restricted to the global CAP_SYS_ADMIN capability. In most cases, it is possible to dump/restore shared memory region without map_files and we need to implement this in CRIU.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[User-mode]]&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Porting crit functionalities in GO ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Implement image view and manipulation in Go&lt;br /&gt;
 &lt;br /&gt;
CRIU's checkpoint images are stored on disk using protobuf. For easier analysis of checkpoint files CRIU has a tool called [[CRIT|CRiu Image Tool (CRIT)]]. It can display/decode CRIU image files from binary protobuf to JSON as well as encode JSON files back to the binary format. With closer integration of CRIU in container runtimes it becomes important to be able to view the CRIU output files. Either for manipulation before restoring or for reading checkpoint statistics (memory pages written to disk, memory pages skipped, process downtime).&lt;br /&gt;
&lt;br /&gt;
Currently CRIT is implemented in Python, for easier integration in other Go projects it is important to have image manipulation and analysis available from GO. This means we need a Go based library to read/modify/write/encode/decode CRIU's image files. Based on this library a Go based implementation of CRIT would be useful.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CRIT]]&lt;br /&gt;
* Possible use case see LXD: https://github.com/lxc/lxd/blob/cb55b1c5a484a43e0c21c6ae8c4a2e30b4d45be3/lxd/migrate_container.go#L179&lt;br /&gt;
* https://github.com/lxc/lxd/pull/4072&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/blob/master/phaul/stats.go&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/pull/28&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Suspended project ideas ==&lt;br /&gt;
&lt;br /&gt;
Listed here are tasks that seem suitable for GSoC, but currently do not have anybody to mentor it.&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt; / &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Linux_kernel&amp;diff=5155</id>
		<title>Linux kernel</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Linux_kernel&amp;diff=5155"/>
		<updated>2021-04-20T08:55:00Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most likely the first thing to enable is the &amp;lt;code&amp;gt;CONFIG_EXPERT=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Configure standard kernel features (expert users)) option, which on x86_64 depends on the &amp;lt;code&amp;gt;CONFIG_EMBEDDED=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Embedded system) one (welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
* ''General setup'' options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE=y&amp;lt;/code&amp;gt; (Checkpoint/restore support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NAMESPACES=y&amp;lt;/code&amp;gt; (Namespaces support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UTS_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; UTS namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IPC_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; IPC namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_SYSVIPC_SYSCTL=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PID_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; PID namespaces)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NET_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; Network namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_FHANDLE=y&amp;lt;/code&amp;gt; (Open by fhandle syscalls)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EVENTFD=y&amp;lt;/code&amp;gt; (Enable eventfd() system call)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EPOLL=y&amp;lt;/code&amp;gt; (Enable eventpoll support)&lt;br /&gt;
* ''Networking support -&amp;gt; Networking options'' options for sock-diag subsystem&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG=y&amp;lt;/code&amp;gt; (Unix domain sockets -&amp;gt; UNIX: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG=y&amp;lt;/code&amp;gt; (Packet socket -&amp;gt; Packet: sockets monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG=y&amp;lt;/code&amp;gt; (Netlink socket -&amp;gt; Netlink: sockets monitoring interface)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETFILTER_XT_MARK=y&amp;lt;/code&amp;gt; (Networking support -&amp;gt; Networking options -&amp;gt; Network packet filtering framework (Netfilter) -&amp;gt; Core Netfilter Configuration -&amp;gt; Netfilter Xtables support (required for ip_tables) -&amp;gt; nfmark target and match support)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_TUN=y&amp;lt;/code&amp;gt; (Networking support -&amp;gt; Universal TUN/TAP device driver support)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other options not required by CRIU, but C/R supported ([[ZDTM test suite]] may fail without them):&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER=y&amp;lt;/code&amp;gt; (File systems -&amp;gt; Inotify support for userspace)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_FANOTIFY=y&amp;lt;/code&amp;gt; (File systems -&amp;gt; Filesystem wide access notification)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MEMCG=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Control Group support -&amp;gt; Memory controller)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_CGROUP_DEVICE=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Control Group support -&amp;gt; Device controller)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MACVLAN=y&amp;lt;/code&amp;gt; (Device Drivers -&amp;gt; Network device support -&amp;gt; Network core driver support -&amp;gt; MAC-VLAN support)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_BRIDGE=y&amp;lt;/code&amp;gt; (Networking support -&amp;gt; Networking options -&amp;gt; 802.1d Ethernet Bridging)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_BINFMT_MISC=y&amp;lt;/code&amp;gt; (Userspace binary formats -&amp;gt; Kernel support for MISC binaries)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION=y&amp;lt;/code&amp;gt; (x86 only) (Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation)&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable the &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY=y&amp;lt;/code&amp;gt; (optional) (Processor type and features -&amp;gt; Track memory changes). In order to enable [[lazy migration]], the [[userfaultfd]] system call is required &amp;lt;code&amp;gt;CONFIG_USERFAULTFD=y&amp;lt;/code&amp;gt; (optional) (General setup -&amp;gt; Enable userfaultfd() system call).&lt;br /&gt;
&lt;br /&gt;
In the beginning of the project we had our [[custom kernel]], which contained some experimental CRIU related patches. Nowadays this is almost not used.&lt;br /&gt;
&lt;br /&gt;
[[Category: Building]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Linux_kernel&amp;diff=5154</id>
		<title>Linux kernel</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Linux_kernel&amp;diff=5154"/>
		<updated>2021-04-20T08:54:43Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: added CONFIG_SYSVIPC_SYSCTL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most likely the first thing to enable is the &amp;lt;code&amp;gt;CONFIG_EXPERT=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Configure standard kernel features (expert users)) option, which on x86_64 depends on the &amp;lt;code&amp;gt;CONFIG_EMBEDDED=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Embedded system) one (welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
* ''General setup'' options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE=y&amp;lt;/code&amp;gt; (Checkpoint/restore support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NAMESPACES=y&amp;lt;/code&amp;gt; (Namespaces support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UTS_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; UTS namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IPC_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; IPC namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_SYSVIPC_SYSCTL&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PID_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; PID namespaces)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NET_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; Network namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_FHANDLE=y&amp;lt;/code&amp;gt; (Open by fhandle syscalls)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EVENTFD=y&amp;lt;/code&amp;gt; (Enable eventfd() system call)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EPOLL=y&amp;lt;/code&amp;gt; (Enable eventpoll support)&lt;br /&gt;
* ''Networking support -&amp;gt; Networking options'' options for sock-diag subsystem&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG=y&amp;lt;/code&amp;gt; (Unix domain sockets -&amp;gt; UNIX: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG=y&amp;lt;/code&amp;gt; (Packet socket -&amp;gt; Packet: sockets monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG=y&amp;lt;/code&amp;gt; (Netlink socket -&amp;gt; Netlink: sockets monitoring interface)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETFILTER_XT_MARK=y&amp;lt;/code&amp;gt; (Networking support -&amp;gt; Networking options -&amp;gt; Network packet filtering framework (Netfilter) -&amp;gt; Core Netfilter Configuration -&amp;gt; Netfilter Xtables support (required for ip_tables) -&amp;gt; nfmark target and match support)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_TUN=y&amp;lt;/code&amp;gt; (Networking support -&amp;gt; Universal TUN/TAP device driver support)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other options not required by CRIU, but C/R supported ([[ZDTM test suite]] may fail without them):&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER=y&amp;lt;/code&amp;gt; (File systems -&amp;gt; Inotify support for userspace)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_FANOTIFY=y&amp;lt;/code&amp;gt; (File systems -&amp;gt; Filesystem wide access notification)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MEMCG=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Control Group support -&amp;gt; Memory controller)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_CGROUP_DEVICE=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Control Group support -&amp;gt; Device controller)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MACVLAN=y&amp;lt;/code&amp;gt; (Device Drivers -&amp;gt; Network device support -&amp;gt; Network core driver support -&amp;gt; MAC-VLAN support)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_BRIDGE=y&amp;lt;/code&amp;gt; (Networking support -&amp;gt; Networking options -&amp;gt; 802.1d Ethernet Bridging)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_BINFMT_MISC=y&amp;lt;/code&amp;gt; (Userspace binary formats -&amp;gt; Kernel support for MISC binaries)&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION=y&amp;lt;/code&amp;gt; (x86 only) (Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation)&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable the &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY=y&amp;lt;/code&amp;gt; (optional) (Processor type and features -&amp;gt; Track memory changes). In order to enable [[lazy migration]], the [[userfaultfd]] system call is required &amp;lt;code&amp;gt;CONFIG_USERFAULTFD=y&amp;lt;/code&amp;gt; (optional) (General setup -&amp;gt; Enable userfaultfd() system call).&lt;br /&gt;
&lt;br /&gt;
In the beginning of the project we had our [[custom kernel]], which contained some experimental CRIU related patches. Nowadays this is almost not used.&lt;br /&gt;
&lt;br /&gt;
[[Category: Building]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=5095</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=5095"/>
		<updated>2020-10-07T09:07:47Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Other stuff */ added info about nftables dependency&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to get CRIU binary on your box.&lt;br /&gt;
&lt;br /&gt;
== Installing from packages ==&lt;br /&gt;
&lt;br /&gt;
Many distributions provide ready-to-use [[packages]]. If no, or the CRIU version you want is not yet there, you will need to get CRIU sources and compile it.&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU sources ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a [https://download.openvz.org/criu/ release tarball] or sync the [https://github.com/checkpoint-restore/criu git repository]. If you plan to modify CRIU sources (e.g. to [[How to submit patches|contribute the code back]]) the latter way is highly recommended. The latest and greatest sources are: {{Latest release}}&lt;br /&gt;
&lt;br /&gt;
== Installing build dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
&lt;br /&gt;
CRIU is mostly written in C and the build system is based on Makefiles. Thus just install standard &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; packages (on Debian use &amp;lt;code&amp;gt;[https://packages.debian.org/build-essential build-essential]&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
For building with [[32bit tasks C/R]] support you will need &amp;lt;code&amp;gt;libc6-dev-i386, gcc-multilib&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[ARM crosscompile|Cross-compilation for ARM]] is also possible.&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [https://developers.google.com/protocol-buffers/ Google Protocol Buffers] to read and write [[images]]. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is used at build time and CRIU is linked with the &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt;. Also [[CRIT]] uses python  bindings and the &amp;lt;code&amp;gt;descriptor.proto&amp;lt;/code&amp;gt; file which typically provided by a distribution's protobuf development package.&lt;br /&gt;
&lt;br /&gt;
; RPM packages&lt;br /&gt;
: &amp;lt;code&amp;gt;protobuf protobuf-c protobuf-c-devel protobuf-compiler protobuf-devel protobuf-python&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Deb packages&lt;br /&gt;
: &amp;lt;code&amp;gt;libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, you may [[build protobuf]] from sources.&lt;br /&gt;
&lt;br /&gt;
=== Other stuff ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;pkg-config&amp;lt;/code&amp;gt; to check on build library dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;python-ipaddress&amp;lt;/code&amp;gt; is used by CRIT to pretty-print IP addresses and is also required by zdtm.py&lt;br /&gt;
* &amp;lt;code&amp;gt;libbsd-devel&amp;lt;/code&amp;gt; (RPM) / &amp;lt;code&amp;gt;libbsd-dev&amp;lt;/code&amp;gt; (DEB) If available, CRIU will be compiled  with &amp;lt;code&amp;gt;setproctitle()&amp;lt;/code&amp;gt; support and set verbose process titles on service workers.&lt;br /&gt;
* &amp;lt;code&amp;gt;iproute2&amp;lt;/code&amp;gt; version 3.5.0 or higher is needed for dumping network namespaces. The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip set as the [[environment variables|&amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt; variable]]&lt;br /&gt;
* &amp;lt;code&amp;gt;nftables&amp;lt;/code&amp;gt; (RPM) / &amp;lt;code&amp;gt;libnftables-dev&amp;lt;/code&amp;gt; (DEB) If available, CRIU will be compiled with nftables C/R support&lt;br /&gt;
* &amp;lt;code&amp;gt;libcap-devel&amp;lt;/code&amp;gt; (RPM) / &amp;lt;code&amp;gt;libcap-dev&amp;lt;/code&amp;gt; (DEB)&lt;br /&gt;
* &amp;lt;code&amp;gt;libnet-devel libnl3-devel&amp;lt;/code&amp;gt; (RPM) / &amp;lt;code&amp;gt;libnet1-dev&amp;lt;/code&amp;gt; (DEB) / &amp;lt;code&amp;gt;libnl-3-dev libnet-dev&amp;lt;/code&amp;gt; (Ubuntu)&lt;br /&gt;
* &amp;lt;code&amp;gt;libaio-devel&amp;lt;/code&amp;gt; (RPM) / &amp;lt;code&amp;gt;libaio-dev&amp;lt;/code&amp;gt; (DEB) is needed to run tests&lt;br /&gt;
* &amp;lt;code&amp;gt;python2-future&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;python3-future&amp;lt;/code&amp;gt; is now needed for zdtm.py tests launcher&lt;br /&gt;
&lt;br /&gt;
For APT use the &amp;lt;code&amp;gt;--no-install-recommends&amp;lt;/code&amp;gt; parameter is to avoid asciidoc pulling in a lot of dependencies.&lt;br /&gt;
Also read about [[ZDTM test suite]] if you will run CRIU tests, those sources need other deps.&lt;br /&gt;
&lt;br /&gt;
== Building the tool ==&lt;br /&gt;
&lt;br /&gt;
Simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory. This is the standard way, but there are some options available.&lt;br /&gt;
&lt;br /&gt;
# There's a ''docker-build'' target in Makefile which builds CRIU in Ubuntu Docker container. Just run &amp;lt;code&amp;gt;make docker-build&amp;lt;/code&amp;gt; and that's it.&lt;br /&gt;
# CRIU has functionality that is either optional or behaves differently depending on the kernel CRIU is running on. By default build process includes maximum of it, but this behavior [[configuring|can be changed]].&lt;br /&gt;
# You may [[Manual build deps|specify build dependencies by hands]]&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
&lt;br /&gt;
CRIU works perfectly even when run from the sources directory (with the &amp;lt;code&amp;gt;./criu/criu&amp;lt;/code&amp;gt; command), but if you want to have in standard paths run &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;. You may need to install &amp;lt;code&amp;gt;asciidoc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;xmlto&amp;lt;/code&amp;gt; packages to make install-man work.&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific config options turned on. Various advanced CRIU features might require even newer kernel.  So the first thing to do is to [[Checking the kernel|check the kernel]] by running &amp;lt;code&amp;gt;criu check&amp;lt;/code&amp;gt;. At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing. If your distribution does not provide needed kernel, you might want to [[Linux kernel|compile one yourself]].&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [[Usage]]&lt;br /&gt;
* [[Advanced usage]]&lt;br /&gt;
* [[:Category:HOWTO]]&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Editor help needed]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=News/events&amp;diff=5086</id>
		<title>News/events</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=News/events&amp;diff=5086"/>
		<updated>2020-08-25T17:05:36Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Linux Plumbers Conference 2020 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt; __NOTOC__&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
   This page is&lt;br /&gt;
   1. used directly (i.e. one can view it);&lt;br /&gt;
   2. included into some other pages;&lt;br /&gt;
   3. exported via RSS.&lt;br /&gt;
   Because of that, extreme care should be taken when modifying it.&lt;br /&gt;
&lt;br /&gt;
   PLEASE MAKE SURE MOST RECENT EVENTS GO FIRST&lt;br /&gt;
&lt;br /&gt;
   --kir&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page collects into about events criu takes part in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;startFeed/&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Linux Plumbers Conference 2020 ==&lt;br /&gt;
[[Image:Linuxplumbers.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''August 24-28, online at https://meet.2020.linuxplumbersconf.org/'''&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/7/contributions/641/ Fast checkpointing with criu-image-streamer]&lt;br /&gt;
[https://youtu.be/fSyr_IXM21Y?t=7762 YouTube]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/7/contributions/642/ FastFreeze: Unprivileged checkpoint/restore for containerized applications]&lt;br /&gt;
[https://youtu.be/fSyr_IXM21Y?t=2654 YouTube]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/7/contributions/640/ CRIU mounts migration: problems and solutions]&lt;br /&gt;
[https://youtu.be/fSyr_IXM21Y?t=1593 YouTube]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/7/contributions/643/ Checkpoint-restoring containers with Docker inside]&lt;br /&gt;
[https://youtu.be/fSyr_IXM21Y?t=6043 YouTube]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phoronix news ==&lt;br /&gt;
[[Image:phoronix.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''August 4, 2020, online'''&lt;br /&gt;
&lt;br /&gt;
[https://www.phoronix.com/scan.php?page=news_item&amp;amp;px=Linux-5.9-Checkpoint-Restore Checkpoint/Restore Of Unprivileged Processes Sent In For Linux 5.9]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FOSDEM 2020 ==&lt;br /&gt;
[[Image:Fosdem.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''Feburary 1, 2020, Brussels, Belgium'''&lt;br /&gt;
&lt;br /&gt;
[https://fosdem.org/2020/schedule/event/containers_live_migration/ Container Live Migration]&lt;br /&gt;
&lt;br /&gt;
--[[User:Rppt]] 19:22, 28 February 2020‎ (UTC)&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Linux Plumbers Conference 2019 ==&lt;br /&gt;
[[Image:Linuxplumbers.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''September 9-11, Lisbon, Portugal'''&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/4/contributions/508/ Update on Task Migration at Google Using CRIU]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/4/contributions/472/ CRIU and the PID dance]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/4/contributions/513/ CRIU: Reworking vDSO proxification, syscall restart]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/4/contributions/478/ Secure Image-less Container Migration]&lt;br /&gt;
&lt;br /&gt;
--[[User:Avagin]] 14:05, 23 Aug 2019 (UTC)&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Google Summer of Code 2019 ==&lt;br /&gt;
[[Image:gsoc.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''Mar-Sep 2019'''&lt;br /&gt;
&lt;br /&gt;
[https://summerofcode.withgoogle.com/organizations/6333591376625664/ Google Summer of Code]&lt;br /&gt;
&lt;br /&gt;
--[[User:Avagin]] 21:32, 26 Feb 2019 (PST) &lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;endFeed/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[News/events/past|Past events]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=News/events&amp;diff=5085</id>
		<title>News/events</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=News/events&amp;diff=5085"/>
		<updated>2020-08-25T16:59:02Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: added information about LPC 2020&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt; __NOTOC__&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
   This page is&lt;br /&gt;
   1. used directly (i.e. one can view it);&lt;br /&gt;
   2. included into some other pages;&lt;br /&gt;
   3. exported via RSS.&lt;br /&gt;
   Because of that, extreme care should be taken when modifying it.&lt;br /&gt;
&lt;br /&gt;
   PLEASE MAKE SURE MOST RECENT EVENTS GO FIRST&lt;br /&gt;
&lt;br /&gt;
   --kir&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page collects into about events criu takes part in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;startFeed/&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Linux Plumbers Conference 2020 ==&lt;br /&gt;
[[Image:Linuxplumbers.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''August 24-28, online at https://meet.2020.linuxplumbersconf.org/'''&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/7/contributions/641/ Fast checkpointing with criu-image-streamer]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/7/contributions/642/ FastFreeze: Unprivileged checkpoint/restore for containerized applications]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/7/contributions/640/ CRIU mounts migration: problems and solutions]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/7/contributions/643/ Checkpoint-restoring containers with Docker inside]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phoronix news ==&lt;br /&gt;
[[Image:phoronix.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''August 4, 2020, online'''&lt;br /&gt;
&lt;br /&gt;
[https://www.phoronix.com/scan.php?page=news_item&amp;amp;px=Linux-5.9-Checkpoint-Restore Checkpoint/Restore Of Unprivileged Processes Sent In For Linux 5.9]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FOSDEM 2020 ==&lt;br /&gt;
[[Image:Fosdem.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''Feburary 1, 2020, Brussels, Belgium'''&lt;br /&gt;
&lt;br /&gt;
[https://fosdem.org/2020/schedule/event/containers_live_migration/ Container Live Migration]&lt;br /&gt;
&lt;br /&gt;
--[[User:Rppt]] 19:22, 28 February 2020‎ (UTC)&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Linux Plumbers Conference 2019 ==&lt;br /&gt;
[[Image:Linuxplumbers.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''September 9-11, Lisbon, Portugal'''&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/4/contributions/508/ Update on Task Migration at Google Using CRIU]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/4/contributions/472/ CRIU and the PID dance]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/4/contributions/513/ CRIU: Reworking vDSO proxification, syscall restart]&lt;br /&gt;
&lt;br /&gt;
[https://linuxplumbersconf.org/event/4/contributions/478/ Secure Image-less Container Migration]&lt;br /&gt;
&lt;br /&gt;
--[[User:Avagin]] 14:05, 23 Aug 2019 (UTC)&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Google Summer of Code 2019 ==&lt;br /&gt;
[[Image:gsoc.png|left|100px|link=]]&lt;br /&gt;
&lt;br /&gt;
'''Mar-Sep 2019'''&lt;br /&gt;
&lt;br /&gt;
[https://summerofcode.withgoogle.com/organizations/6333591376625664/ Google Summer of Code]&lt;br /&gt;
&lt;br /&gt;
--[[User:Avagin]] 21:32, 26 Feb 2019 (PST) &lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;endFeed/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[News/events/past|Past events]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5028</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5028"/>
		<updated>2020-03-04T12:16:29Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Project ideas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Post-copy for shared memory and hugetlbfs ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' extend post-copy memory restore and migration to support shared memory and hugetlbfs.&lt;br /&gt;
&lt;br /&gt;
CRIU relies on [[Userfaultfd]] mechanism in the Linux kernel to implement the demand paging in userspace and allow post-copy memory (or lazy) [[Lazy_migration|migration]]. However, currently this support is limited to anonymous private memory mappings, although kernel also supports shared memory areas and hugetlbfs backed memory.&lt;br /&gt;
&lt;br /&gt;
The shared memory support for lazy migration can be added to CRIU without kernel modifications, while proper handling of hugetlbfs would require userfaultfd callbacks for [http://man7.org/linux/man-pages/man2/fallocate.2.html fallocate(PUNCH_HOLE)] and [http://man7.org/linux/man-pages/man2/madvise.2.html madvise(MADV_REMOVE)] system calls.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [https://www.kernel.org/doc/html/latest/admin-guide/mm/userfaultfd.html Userfaultfd]&lt;br /&gt;
* [https://www.kernel.org/doc/html/latest/admin-guide/mm/hugetlbpage.html hugetlbfs]&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: most probably advanced?&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Mike Rapoport &amp;lt;rppt@linux.ibm.com&amp;gt;&lt;br /&gt;
* Suggested by: Mike Rapoport &amp;lt;rppt@linux.ibm.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Porting crit functionalities in GO ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Implement image view and manipulation in Go&lt;br /&gt;
 &lt;br /&gt;
CRIU's checkpoint images are stored on disk using protobuf. For easier analysis of checkpoint files CRIU has a tool called [[CRIT|CRiu Image Tool (CRIT)]]. It can display/decode CRIU image files from binary protobuf to JSON as well as encode JSON files back to the binary format. With closer integration of CRIU in container runtimes it becomes important to be able to view the CRIU output files. Either for manipulation before restoring or for reading checkpoint statistics (memory pages written to disk, memory pages skipped, process downtime).&lt;br /&gt;
&lt;br /&gt;
Currently CRIT is implemented in Python, for easier integration in other Go projects it is important to have image manipulation and analysis available from GO. This means we need a Go based library to read/modify/write/encode/decode CRIU's image files. Based on this library a Go based implementation of CRIT would be useful.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CRIT]]&lt;br /&gt;
* Possible use case see LXD: https://github.com/lxc/lxd/blob/cb55b1c5a484a43e0c21c6ae8c4a2e30b4d45be3/lxd/migrate_container.go#L179&lt;br /&gt;
* https://github.com/lxc/lxd/pull/4072&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/blob/master/phaul/stats.go&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Mentor: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Memory changes tracking with userfaultfd-WP ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' add ability to track memory changes of the snapshotted processes using userfaultfd-WP&lt;br /&gt;
&lt;br /&gt;
Currently CRIU uses [[Memory_changes_tracking|Soft-dirty]] mechanism in Linux kernel to track memory changes.&lt;br /&gt;
This mechanism can be complemented (or even completely replaced) with recently proposed write protection support for&lt;br /&gt;
userfaultfd (userfaultfd-WP).&lt;br /&gt;
&lt;br /&gt;
Userfault allows implementation of paging in userspace. It allows an application to receive notifications about page faults and provide the desired memory contents for the faulting pages. In the current upstream kernels only missing page faults are supported, but there is an ongoing work to allow notifications for write faults as well. Using such notifications it would be possible to precisely track memory changes during pre-dump iterations. This approach may prove to be more efficient than soft-dirty.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [https://www.kernel.org/doc/html/latest/admin-guide/mm/userfaultfd.html Userfaultfd]&lt;br /&gt;
* [https://github.com/xzpeter/linux/tree/uffd-wp-merged Userfaultfd-WP]&lt;br /&gt;
* [https://www.kernel.org/doc/html/latest/admin-guide/mm/soft-dirty.html?highlight=soft%20dirty Soft-Dirty]&lt;br /&gt;
* https://lwn.net/Articles/777258/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: most probably advanced?&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Mike Rapoport &amp;lt;rppt@linux.ibm.com&amp;gt;&lt;br /&gt;
* Suggested by: Mike Rapoport &amp;lt;rppt@linux.ibm.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use ePBF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Restrict checks for open/mmaped files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Make sure the file opened (for fd or mapping) at restore is &amp;quot;the same&amp;quot; as it was on dump&lt;br /&gt;
&lt;br /&gt;
CRIU doesn't carry files contents (except for ghost ones) into images. Thus on dump it saves some &amp;quot;meta&amp;quot; for file to validate it's &amp;quot;the same&amp;quot; on restore. Currently this meta includes only the file size. The task is to add some cookie value that's somehow affected by file's contents. This is primarily needed to reduce the possibility to restore with wrong libraries.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/Category:Files&lt;br /&gt;
* https://en.wikipedia.org/wiki/File_verification&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
* https://patchwork.criu.org/series/137/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov1@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt; / &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5015</id>
		<title>Google Summer of Code Ideas</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5015"/>
		<updated>2020-02-28T07:49:18Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Add support for SPFS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google Summer of Code (GSoC) is a global program that offers post-secondary students an opportunity to be paid for contributing to an open source project over a three month period. &lt;br /&gt;
&lt;br /&gt;
This page contains project ideas for upcoming Google Summer of Code.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Please contact the respective mentor for the idea you are interested in. For general questions feel free to send an email to the [mailto:criu@openvz.org mailing list] or write in [https://gitter.im/save-restore/criu gitter].&lt;br /&gt;
&lt;br /&gt;
== Project ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Post-copy for shared memory and hugetlbfs ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' extend post-copy memory restore and migration to support shared memory and hugetlbfs.&lt;br /&gt;
&lt;br /&gt;
CRIU relies on [[Userfaultfd]] mechanism in the Linux kernel to implement the demand paging in userspace and allow post-copy memory (or lazy) [[Lazy_migration|migration]]. However, currently this support is limited to anonymous private memory mappings, although kernel also supports shared memory areas and hugetlbfs backed memory.&lt;br /&gt;
&lt;br /&gt;
The shared memory support for lazy migration can be added to CRIU without kernel modifications, while proper handling of hugetlbfs would require userfaultfd callbacks for [http://man7.org/linux/man-pages/man2/fallocate.2.html fallocate(PUNCH_HOLE)] and [http://man7.org/linux/man-pages/man2/madvise.2.html madvise(MADV_REMOVE)] system calls.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [https://www.kernel.org/doc/html/latest/admin-guide/mm/userfaultfd.html Userfaultfd]&lt;br /&gt;
* [https://www.kernel.org/doc/html/latest/admin-guide/mm/hugetlbpage.html hugetlbfs]&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: most probably advanced?&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Mike Rapoport &amp;lt;rppt@linux.ibm.com&amp;gt;&lt;br /&gt;
* Suggested by: Mike Rapoport &amp;lt;rppt@linux.ibm.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optimize logging engine ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.&lt;br /&gt;
&lt;br /&gt;
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.&lt;br /&gt;
&lt;br /&gt;
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.&lt;br /&gt;
&lt;br /&gt;
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each &amp;lt;code&amp;gt;log(fmt, ...)&amp;lt;/code&amp;gt; call gets translated into a call to a binary log function that saves &amp;lt;code&amp;gt;fmt&amp;lt;/code&amp;gt; identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Better logging]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C, though decoder/preprocessor can be in any language&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
* Suggested by: Andrei Vagin &amp;lt;avagin@gmail.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add support for checkpoint/restore of CORK-ed UDP socket ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Support C/R of corked UDP socket&lt;br /&gt;
 &lt;br /&gt;
There's UDP_CORK option for sockets. As man page says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    If this option is enabled, then all data output on this socket&lt;br /&gt;
    is accumulated into a single datagram that is transmitted when&lt;br /&gt;
    the option is disabled.  This option should not be used in&lt;br /&gt;
    code intended to be portable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently criu refuses to dump this case, so it's effectively a bug. Supporting&lt;br /&gt;
this will need extending the kernel API to allow criu read back the write queue&lt;br /&gt;
of the socket (see [[TCP connection|how it's done]] for TCP sockets, for example). Then&lt;br /&gt;
the queue is written into the image and is restored into the socket (with the CORK&lt;br /&gt;
bit set too).&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/409&lt;br /&gt;
* [[Sockets]], [[TCP connection]]&lt;br /&gt;
* [[https://groups.google.com/forum/#!topic/comp.os.linux.networking/Uz8PYiTCZSg UDP cork explained]]&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate (+linux kernel)&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Anonymise image files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Teach [[CRIT]] to remove sensitive information from images&lt;br /&gt;
 &lt;br /&gt;
When reporting a BUG it may be not acceptable for the reporter to send us raw images, as they may contain sensitive data. Need to teach CRIT to &amp;quot;anonymise&amp;quot; images for publication.&lt;br /&gt;
&lt;br /&gt;
List of data to shred:&lt;br /&gt;
&lt;br /&gt;
* Memory contents. For the sake of investigation, all the memory contents can be just removed. Only the sizes of pages*.img files are enough.&lt;br /&gt;
* Paths to files. Here we should keep the paths relations to each other. The simplest way seem to be replacing file names with &amp;quot;random&amp;quot; (or sequential) strings, BUT (!) keeping an eye on making this mapping be 1:1. Note, that file paths may also sit in sk-unix.img.&lt;br /&gt;
* Registers.&lt;br /&gt;
* Process names. (But relations should be kept).&lt;br /&gt;
* Contents of streams, i.e. pipe/fifo data, sk-queue, tcp-stream, tty data.&lt;br /&gt;
* Ghost files.&lt;br /&gt;
* Tarballs with tmpfs-s.&lt;br /&gt;
* IP addresses in sk-inet-s, ip tool dumps and net*.img.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Anonymize image files]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/360&lt;br /&gt;
* [[CRIT]], [[Images]]&lt;br /&gt;
* External links to mailing lists or web sites&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Python&lt;br /&gt;
* Mentor: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelianov &amp;lt;xemul@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Porting crit functionalities in GO ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Implement image view and manipulation in Go&lt;br /&gt;
 &lt;br /&gt;
CRIU's checkpoint images are stored on disk using protobuf. For easier analysis of checkpoint files CRIU has a tool called [[CRIT|CRiu Image Tool (CRIT)]]. It can display/decode CRIU image files from binary protobuf to JSON as well as encode JSON files back to the binary format. With closer integration of CRIU in container runtimes it becomes important to be able to view the CRIU output files. Either for manipulation before restoring or for reading checkpoint statistics (memory pages written to disk, memory pages skipped, process downtime).&lt;br /&gt;
&lt;br /&gt;
Currently CRIT is implemented in Python, for easier integration in other Go projects it is important to have image manipulation and analysis available from GO. This means we need a Go based library to read/modify/write/encode/decode CRIU's image files. Based on this library a Go based implementation of CRIT would be useful.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[CRIT]]&lt;br /&gt;
* Possible use case see LXD: https://github.com/lxc/lxd/blob/cb55b1c5a484a43e0c21c6ae8c4a2e30b4d45be3/lxd/migrate_container.go#L179&lt;br /&gt;
* https://github.com/lxc/lxd/pull/4072&lt;br /&gt;
* https://github.com/checkpoint-restore/go-criu/blob/master/phaul/stats.go&lt;br /&gt;
 &lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: Go&lt;br /&gt;
* Mentor: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Memory changes tracking with userfaultfd-WP ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' add ability to track memory changes of the snapshotted processes using userfaultfd-WP&lt;br /&gt;
&lt;br /&gt;
Currently CRIU uses [[Memory_changes_tracking|Soft-dirty]] mechanism in Linux kernel to track memory changes.&lt;br /&gt;
This mechanism can be complemented (or even completely replaced) with recently proposed write protection support for&lt;br /&gt;
userfaultfd (userfaultfd-WP).&lt;br /&gt;
&lt;br /&gt;
Userfault allows implementation of paging in userspace. It allows an application to receive notifications about page faults and provide the desired memory contents for the faulting pages. In the current upstream kernels only missing page faults are supported, but there is an ongoing work to allow notifications for write faults as well. Using such notifications it would be possible to precisely track memory changes during pre-dump iterations. This approach may prove to be more efficient than soft-dirty.&lt;br /&gt;
 &lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [https://www.kernel.org/doc/html/latest/admin-guide/mm/userfaultfd.html Userfaultfd]&lt;br /&gt;
* [https://github.com/xzpeter/linux/tree/uffd-wp-merged Userfaultfd-WP]&lt;br /&gt;
* [https://www.kernel.org/doc/html/latest/admin-guide/mm/soft-dirty.html?highlight=soft%20dirty Soft-Dirty]&lt;br /&gt;
* https://lwn.net/Articles/777258/&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: most probably advanced?&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Mike Rapoport &amp;lt;rppt@linux.ibm.com&amp;gt;&lt;br /&gt;
* Suggested by: Mike Rapoport &amp;lt;rppt@linux.ibm.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use eBPF to lock and unlock the network ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Use ePBF instead of external iptables-restore tool for network lock and unlock.&lt;br /&gt;
&lt;br /&gt;
During checkpointing and restoring CRIU locks the network to make sure no network packets are accepted by the network stack during the time the process is checkpointed. Currently CRIU calls out to iptables-restore to create and delete the corresponding iptables rules. Another approach which avoids calling out to the external binary iptables-restore would be to directly inject eBPF rules. There have been reports from users that iptables-restore fails in some way and eBPF could avoid this external dependency.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/TCP_connection#Checkpoint_and_restore_TCP_connection&lt;br /&gt;
* https://github.com/systemd/systemd/blob/master/src/core/bpf-firewall.c&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: intermediate&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
* Suggested by: Adrian Reber &amp;lt;areber@redhat.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Restrict checks for open/mmaped files ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Make sure the file opened (for fd or mapping) at restore is &amp;quot;the same&amp;quot; as it was on dump&lt;br /&gt;
&lt;br /&gt;
CRIU doesn't carry files contents (except for ghost ones) into images. Thus on dump it saves some &amp;quot;meta&amp;quot; for file to validate it's &amp;quot;the same&amp;quot; on restore. Currently this meta includes only the file size. The task is to add some cookie value that's somehow affected by file's contents. This is primarily needed to reduce the possibility to restore with wrong libraries.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://www.criu.org/Category:Files&lt;br /&gt;
* https://en.wikipedia.org/wiki/File_verification&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: beginner&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
* Suggested by: Pavel Emelyanov &amp;lt;xemul@openvz.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
=== Add support for SPFS ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' The SPFS is a special filesystem that allows checkpoint and restore of such things as NFS and FUSE&lt;br /&gt;
&lt;br /&gt;
NFS support is already implemented in Virtuozzo CRIU, but it's very beneficial to port it to mainline CRIU. The importaint part of it is the need to implement the integration of Stub-Proxy File System (SPFS) with LXC/yet_another_containers_environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Links'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/60&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/53&lt;br /&gt;
* https://github.com/skinsbursky/spfs&lt;br /&gt;
&lt;br /&gt;
'''Details:'''&lt;br /&gt;
* Skill level: expert&lt;br /&gt;
* Language: C&lt;br /&gt;
* Mentor: Radostin Stoyanov &amp;lt;rstoyanov1@gmail.com&amp;gt;, Alexander Mikhalitsyn &amp;lt;alexander@mihalicyn.com&amp;gt; / &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
* Suggested by: Alexander Mikhalitsyn &amp;lt;alexander.mikhalitsyn@virtuozzo.com&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Contacts&amp;diff=5014</id>
		<title>Contacts</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Contacts&amp;diff=5014"/>
		<updated>2020-02-25T13:00:48Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: added info about GitHub organization and Gitter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are many ways to contact CRIU community. This page contains official accounts in social networks and another points of connect.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/checkpoint-restore GitHub checkpoint-restore project]&lt;br /&gt;
* [https://gitter.im/save-restore/CRIU Gitter]&lt;br /&gt;
* [https://twitter.com/__criu__ CRIU twitter]&lt;br /&gt;
* [https://www.youtube.com/channel/UCeXb0oWYd7ZE-44TrTSWxmg Youtube channel]&lt;br /&gt;
* [https://lists.openvz.org/mailman/listinfo/criu Mailing list]&lt;br /&gt;
* IRC channels on Freenode:&lt;br /&gt;
** [https://webchat.freenode.net/?channels=#criu #criu] - developers talks. Logs are [https://botbot.me/freenode/criu/ available].&lt;br /&gt;
** [https://webchat.freenode.net/?channels=#criu-commit-bot #criu-commit-bot] - commits to CRIU source code repository&lt;br /&gt;
** [https://webchat.freenode.net/?channels=#criu-ci #criu-ci] - status of CI jobs from Jenkins&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://openvz.org/Contacts OpenVZ contacts]&lt;br /&gt;
&lt;br /&gt;
[[Category: Communication]]&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=GSoC_Students_Recommendations&amp;diff=5013</id>
		<title>GSoC Students Recommendations</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=GSoC_Students_Recommendations&amp;diff=5013"/>
		<updated>2020-02-25T12:58:54Z</updated>

		<summary type="html">&lt;p&gt;Amikhalitsyn: /* Contacts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:GSoC]]&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
The entry points for the community is the [https://github.com/checkpoint-restore GitHub checkpoint-restore project], [https://gitter.im/save-restore/CRIU Gitter] and &amp;lt;code&amp;gt;criu@openvz.org&amp;lt;/code&amp;gt; mailing list. Also, the [[Google Summer of Code Ideas|ideas]] page contains mentors' personal e-mails for each sub-project.&lt;br /&gt;
&lt;br /&gt;
== Takeoff ==&lt;br /&gt;
&lt;br /&gt;
Starting playing with CRIU is as simple as one, two, three:&lt;br /&gt;
&lt;br /&gt;
# Get the sources from [https://github.com/checkpoint-restore/criu]&lt;br /&gt;
# Build them with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;&lt;br /&gt;
# Do your first C/R by running a simple test with &amp;lt;code&amp;gt;zdtm.py run -t static/env00&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here are links for further reading&lt;br /&gt;
&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* [[CLI]]&lt;br /&gt;
* [[Simple loop]]&lt;br /&gt;
* [[ZDTM test suite]]&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
When a new patch is ready, it can be submitted for merging either [[How_to_submit_patches|via the CRIU mailing list]] (recommended) or via github PR.&lt;/div&gt;</summary>
		<author><name>Amikhalitsyn</name></author>
	</entry>
</feed>