<?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=Prajwal+S+N</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=Prajwal+S+N"/>
	<link rel="alternate" type="text/html" href="https://criu.org/Special:Contributions/Prajwal_S_N"/>
	<updated>2026-05-13T14:27:34Z</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=5617</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=5617"/>
		<updated>2025-03-10T18:52:43Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: &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;
=== 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;
=== 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;&lt;br /&gt;
* Suggested by: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.com&amp;gt;&lt;br /&gt;
&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].&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 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;
=== Coordinated checkpointing of distributed applications ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Enable coordinated container checkpointing with Kubernetes.&lt;br /&gt;
&lt;br /&gt;
Checkpointing support has been recently introduced in Kubernetes, where the&lt;br /&gt;
smallest deployable unit is a Pod (a group of containers).  Kubernetes is often&lt;br /&gt;
used to deploy applications that are distributed across multiple nodes.&lt;br /&gt;
However, checkpointing such distributed applications requires a coordination&lt;br /&gt;
mechanism to synchronize the checkpoint and restore operations. To address this&lt;br /&gt;
challenge, we have developed a new tool called &amp;lt;code&amp;gt;criu-coordinator&amp;lt;/code&amp;gt;&lt;br /&gt;
that relies on the action-script functionality of CRIU to enable synchronization&lt;br /&gt;
in distributed environments. This project aims to extend this tool to enable&lt;br /&gt;
seamless integration with the checkpointing functionality of Kubernetes.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu-coordinator&lt;br /&gt;
* https://lpc.events/event/18/contributions/1803/&lt;br /&gt;
* https://sched.co/1YeT4&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: Rust / Go / 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: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&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>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=GSoC_Students_Recommendations&amp;diff=5616</id>
		<title>GSoC Students Recommendations</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=GSoC_Students_Recommendations&amp;diff=5616"/>
		<updated>2025-03-10T18:45:57Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:GSoC]]&lt;br /&gt;
This page provides some insights for potential Google Summer of Code (GSoC) contributors. By following these recommendations, students can increase their chances of success in the programme and gain valuable skills and experience in open-source development.&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;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Starting playing with CRIU is as simple as:&lt;br /&gt;
&lt;br /&gt;
# Get the sources from [https://github.com/checkpoint-restore/criu the GitHub repository]&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 zdtm/static/env00&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The links below include some additional resources that you may find helpful to explore further.&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;
Once a new patch is prepared, it can be submitted for merging by creating a [https://github.com/checkpoint-restore/criu/blob/criu-dev/CONTRIBUTING.md GitHub pull request].&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5615</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=5615"/>
		<updated>2025-03-10T18:44:54Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Add link to student recommendations&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;
=== 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;
=== 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;
&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].&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 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;
=== Coordinated checkpointing of distributed applications ===&lt;br /&gt;
 &lt;br /&gt;
'''Summary:''' Enable coordinated container checkpointing with Kubernetes.&lt;br /&gt;
&lt;br /&gt;
Checkpointing support has been recently introduced in Kubernetes, where the&lt;br /&gt;
smallest deployable unit is a Pod (a group of containers).  Kubernetes is often&lt;br /&gt;
used to deploy applications that are distributed across multiple nodes.&lt;br /&gt;
However, checkpointing such distributed applications requires a coordination&lt;br /&gt;
mechanism to synchronize the checkpoint and restore operations. To address this&lt;br /&gt;
challenge, we have developed a new tool called &amp;lt;code&amp;gt;criu-coordinator&amp;lt;/code&amp;gt;&lt;br /&gt;
that relies on the action-script functionality of CRIU to enable synchronization&lt;br /&gt;
in distributed environments. This project aims to extend this tool to enable&lt;br /&gt;
seamless integration with the checkpointing functionality of Kubernetes.&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* https://github.com/checkpoint-restore/criu-coordinator&lt;br /&gt;
* https://lpc.events/event/18/contributions/1803/&lt;br /&gt;
* https://sched.co/1YeT4&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: Rust / Go / 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: Radostin Stoyanov &amp;lt;rstoyanov@fedoraproject.org&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>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5455</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=5455"/>
		<updated>2024-01-30T22:16:43Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: /* Kubernetes operator for managing container checkpoints */&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: 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;
=== 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;
* 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://kubernetes.io/docs/concepts/extend-kubernetes/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;
=== 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>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5450</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=5450"/>
		<updated>2024-01-15T18:33:43Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: /* Use eBPF to lock and unlock the network */&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: 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;
=== 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;
* 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;
== 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>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5449</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=5449"/>
		<updated>2024-01-15T13:45:31Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: &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: 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;
=== 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;
=== 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;
== 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>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Iterative_migration&amp;diff=5330</id>
		<title>Iterative migration</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Iterative_migration&amp;diff=5330"/>
		<updated>2023-01-12T18:10:28Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Add kill command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to reduce the freeze time of an application by using the [[memory changes tracking]] ability to perform [[wikipedia:Live_migration#Pre-copy_memory_migration|pre-copy memory migration]].&lt;br /&gt;
&lt;br /&gt;
{{Note|It is assumed that you already read [[Live migration]] article before this one.}}&lt;br /&gt;
&lt;br /&gt;
== Migration sequence ==&lt;br /&gt;
&lt;br /&gt;
The steps below look like those in regular live migration, but include one or more pre-dump stages.&lt;br /&gt;
&lt;br /&gt;
=== Pre-dump ===&lt;br /&gt;
Take tasks you are about to migrate and pre-dump them into some place. Tasks will remain running after pre-dump, unlike regular dump.&lt;br /&gt;
&lt;br /&gt;
 [src]# criu pre-dump --tree &amp;lt;pid&amp;gt; --images-dir &amp;lt;path-to-existing-directory-A&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The directory with images can be on a shared storage, or you can use [[disk-less migration]] to avoid the '''Copy''' step.&lt;br /&gt;
&lt;br /&gt;
Now you can either proceed to next step and do regular dump, or perform the pre-dump step again. In the latter case pre-dump would generate another set of pre-dump images which will contain memory changed after previous pre-dump. Doing several pre-dump iterations may reduce the amount of data dumped on dump stage and thus lead to shorter freeze time.&lt;br /&gt;
&lt;br /&gt;
Note, that if you're going to perform more than one pre-dump steps, you should create different directories for images and properly reference them with the &amp;lt;code&amp;gt;--images-dir&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;--prev-images-dir&amp;lt;/code&amp;gt; for all pre-dump and dump steps.&lt;br /&gt;
&lt;br /&gt;
=== Dump ===&lt;br /&gt;
Now you can do regular dump of your processes.&lt;br /&gt;
&lt;br /&gt;
 [src]# criu dump --tree &amp;lt;pid&amp;gt; --images-dir &amp;lt;path-to-existing-directory-B&amp;gt; \&lt;br /&gt;
  --prev-images-dir &amp;lt;path-to-directory-A-relative-to-B&amp;gt; --leave-stopped --track-mem&lt;br /&gt;
&lt;br /&gt;
Note that:&lt;br /&gt;
&lt;br /&gt;
# this dump would work faster than without pre-dump, as this dump only takes the memory that has changed since the last pre-dump;&lt;br /&gt;
# the &amp;lt;code&amp;gt;--prev-images-dir&amp;lt;/code&amp;gt; should contain path to the directory with pre-dump images ''relative to the directory where the dump images will be put''.&lt;br /&gt;
&lt;br /&gt;
=== Copy ===&lt;br /&gt;
Copy images to the destination node:&lt;br /&gt;
&lt;br /&gt;
 [src]# scp -r &amp;lt;path-to-images-dir&amp;gt; &amp;lt;dst&amp;gt;:/&amp;lt;path-to-images&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or using rsync&lt;br /&gt;
&lt;br /&gt;
 [src]# rsync -rl &amp;lt;path-to-images-dir&amp;gt;/ &amp;lt;dst&amp;gt;:&amp;lt;path-to-images&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: It is important to enable &amp;quot;copy symlinks as symlinks&amp;quot; (&amp;lt;code&amp;gt;-l&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt;) to ensure that symlinks are preserved between previous directories. When &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; is passed to &amp;lt;code&amp;gt;scp&amp;lt;/code&amp;gt; it will follow symbolic links encountered in the tree traversal.&lt;br /&gt;
&lt;br /&gt;
=== Restore ===&lt;br /&gt;
On the destination node restore the apps from images:&lt;br /&gt;
&lt;br /&gt;
 [dst]# criu restore --images-dir &amp;lt;path-to-images&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill ===&lt;br /&gt;
If everything went OK you can kill stopped tasks on the source node:&lt;br /&gt;
&lt;br /&gt;
 [src]# kill &amp;lt;pid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [[P.Haul]] is the Go extension to CRIU doing [[live migration]]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Memory]]&lt;br /&gt;
[[Category: Live migration]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Live_migration&amp;diff=5329</id>
		<title>Live migration</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Live_migration&amp;diff=5329"/>
		<updated>2023-01-12T18:08:16Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Add kill command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note|The main article about live-migration is [[P.Haul|here]]. The article below is just description of how it can be done.}}&lt;br /&gt;
&lt;br /&gt;
Live migration attempts to provide a seamless transfer of service between physical machines without impacting client processes or applications.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; utility can be used to perform live migration of apps or containers. This page is a sort of HOWTO describing this.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
In order to live-migrate an application or a container you should make sure, that files, that are/can be accessed by processes you're migrating are available on both nodes -- source and destination. This can be achieved by using either shared file-system such as NFS, GlusterFS or CEPH, or by using &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; to copy files from one box to another. Further in this article we assume, that the file-system is the same on both sides.&lt;br /&gt;
&lt;br /&gt;
Another thing you should take care of is the networking. General rule here is that IP addresses, that your application uses should be available on the destination host. The reason for that is -- when restoring TCP sockets CRIU will try to bind() and connect() them back using their original credentials, and if the requested IP address is not available for some reason on the destination side, the respective system call will fail. Also during migration the connections will be locked by CRIU and there are two options here.&lt;br /&gt;
&lt;br /&gt;
First, is when your app shares the networking with the host. In this case CRIU locks connections using iptables rules, so you should make sure the rules are available on the destination side. Second option is when the app lives in a net namespace (a container). In this case CRIU will call [[action scripts]] to lock the network and it's up to you how to lock it. In case of [[Docker]] the latter daemon handles it by the libnetwork library.&lt;br /&gt;
&lt;br /&gt;
Said that, in order to live migrate tasks you should do these steps:&lt;br /&gt;
&lt;br /&gt;
=== Dump ===&lt;br /&gt;
Take tasks you're about to migrate and dump them into some place, asking &amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; to leave them in stopped state after dump:&lt;br /&gt;
&lt;br /&gt;
 [src]# criu dump --tree &amp;lt;pid&amp;gt; --images-dir &amp;lt;path-to-existing-directory&amp;gt; --leave-stopped&lt;br /&gt;
&lt;br /&gt;
The directory you put images to can reside on the shared file-system if you're using one. In this case you can skip the Copy step and proceed to Restore.&lt;br /&gt;
&lt;br /&gt;
=== Copy ===&lt;br /&gt;
Copy images to destination node:&lt;br /&gt;
&lt;br /&gt;
 [src]# scp -r &amp;lt;path-to-images-dir&amp;gt; &amp;lt;dst&amp;gt;:/&amp;lt;path-to-images&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Restore ===&lt;br /&gt;
Go to the destination node and restore the apps from images on it:&lt;br /&gt;
&lt;br /&gt;
 [dst]# criu restore --images-dir &amp;lt;path-to-images&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill ===&lt;br /&gt;
If everything went OK you can return on the source node and kill stopped tasks on it.&lt;br /&gt;
&lt;br /&gt;
 [src]# kill &amp;lt;pid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* The directories with images would contain two copies of applications memory, which may be space-consuming. The CRIU can perform [[disk-less migration]] to address this.&lt;br /&gt;
&lt;br /&gt;
* Another issue with this way of doing live migration is that while copying memory on remote host tasks remain frozen. If there's a LOT of memory, this freeze time can be big. CRIU can speed this up by doing [[iterative migration]].&lt;br /&gt;
&lt;br /&gt;
* If you're live migrating a shell job, remember that &amp;lt;code&amp;gt;--shell-job&amp;lt;/code&amp;gt; option must be used on both stages -- dump and restore. See more details about shell jobs [[Advanced usage|here]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[P.Haul]]&lt;br /&gt;
* [[Iterative migration]]&lt;br /&gt;
* [[Disk-less migration]]&lt;br /&gt;
* [[Lazy migration]]&lt;br /&gt;
* [[Page server]]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Live migration]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=GSoC_completed_projects&amp;diff=5314</id>
		<title>GSoC completed projects</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=GSoC_completed_projects&amp;diff=5314"/>
		<updated>2022-09-22T07:48:29Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Add completed project (Porting CRIT to Go)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
'''Merged:''' https://github.com/checkpoint-restore/criu/pull/1123&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;
=== Optimize the pre-dump algorithm ===&lt;br /&gt;
&lt;br /&gt;
'''Summary:''' Optimize the pre-dump algorithm to avoid pinning to many memory in RAM&lt;br /&gt;
&lt;br /&gt;
'''Merged:''' https://github.com/checkpoint-restore/criu/commit/98608b90de0f853b1c8a6e15b312320e1441c359 &lt;br /&gt;
&lt;br /&gt;
Current [[CLI/cmd/pre-dump|pre-dump]] mode is used to write task memory contents into image&lt;br /&gt;
files w/o stopping the task for too long. It does this by stopping the task, infecting it and&lt;br /&gt;
draining all the memory into a set of pipes. Then the task is cured, resumed and the pipes'&lt;br /&gt;
contents is written into images (maybe a [[page server]]). Unfortunately, this approach creates&lt;br /&gt;
a big stress on the memory subsystem, as keeping all memory in pipes creates a lot of unreclaimable&lt;br /&gt;
memory (pages in pipes are not swappable), as well as the number of pipes themselves can be huge, as&lt;br /&gt;
one pipe doesn't store more than a fixed amount of data (see pipe(7) man page).&lt;br /&gt;
&lt;br /&gt;
A solution for this problem is to use a sys_read_process_vm() syscall, which will mitigate&lt;br /&gt;
all of the above. To do this we need to allocate a temporary buffer in criu, then walk the&lt;br /&gt;
target process vm by copying the memory piece-by-piece into it, then flush the data into image&lt;br /&gt;
(or page server), and repeat.&lt;br /&gt;
&lt;br /&gt;
Ideally there should be sys_splice_process_vm() syscall in the kernel, that does the same as&lt;br /&gt;
the read_process_vm does, but vmsplices the data&lt;br /&gt;
&lt;br /&gt;
'''Links:'''&lt;br /&gt;
* [[Memory pre dump]]&lt;br /&gt;
* https://github.com/checkpoint-restore/criu/issues/351&lt;br /&gt;
* [[Memory dumping and restoring]], [[Memory changes tracking]]&lt;br /&gt;
* [http://man7.org/linux/man-pages/man2/process_vm_readv.2.html process_vm_readv(2)] [http://man7.org/linux/man-pages/man2/vmsplice.2.html vmsplice(2)] [https://lkml.org/lkml/2018/1/9/32 RFC for splice_process_vm syscall]&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;
'''Merged:''' https://github.com/checkpoint-restore/go-criu/pull/66&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 (Go library)]]&lt;br /&gt;
* https://github.com/snprajwal/gsoc-2022&lt;br /&gt;
&lt;br /&gt;
[[Category:GSoC]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5313</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=5313"/>
		<updated>2022-09-22T07:47:06Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: &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;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.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;
=== 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;
* 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;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Google_Summer_of_Code_Ideas&amp;diff=5312</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=5312"/>
		<updated>2022-09-22T07:46:10Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Removed completed project (Porting CRIT to Go)&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;
* Mentor: Pavel Tikhomirov &amp;lt;ptikhomirov@virtuozzo.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;
=== 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;
&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;
&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=5309</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=5309"/>
		<updated>2022-08-12T09:03:36Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This page describes the CRIT Python tool. For the Go library, see [[CRIT (Go library)]]''.&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool is a feature-rich replacement for existing &amp;quot;criu show&amp;quot;.&lt;br /&gt;
It is written completely in Python, so it is quite easy to read the code and extend its features.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] {decode,encode,info,x,show} ...&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode,info,x,show}&lt;br /&gt;
                        Use crit CMD --help for command-specific help&lt;br /&gt;
    decode              convert criu image from binary type to json&lt;br /&gt;
    encode              convert criu image from json type to binary&lt;br /&gt;
    info                show info about image&lt;br /&gt;
    x                   explore image dir&lt;br /&gt;
    show                convert criu image from binary to human-readable json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pretty output ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit decode&amp;lt;/code&amp;gt; prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. CRIT can do this when using the &amp;lt;code&amp;gt;show&amp;lt;/code&amp;gt; action or the &amp;lt;code&amp;gt;--pretty&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
Wend doing pretty optput CRIT does a little bit more, than just multiline indented JSON.&lt;br /&gt;
&lt;br /&gt;
; Addresses and registers&lt;br /&gt;
: VM addresses and core.img register values are all printed in hex. Since JSON doesn't support this form of numbers, such fields are encoded as strings.&lt;br /&gt;
&lt;br /&gt;
; Bit-fields&lt;br /&gt;
: Such things as flags and masks (e.g. sig-block mask) are also better understood when written in hex, so CRIT does this.&lt;br /&gt;
&lt;br /&gt;
; IP addresses&lt;br /&gt;
: By default those a printed in decimal, but the &amp;quot;1.2.3.4&amp;quot; for v4 or &amp;quot;::1&amp;quot; for v6 can be seen in the --pretty mode.&lt;br /&gt;
&lt;br /&gt;
; Symbolic names for flags&lt;br /&gt;
: Some known bit sets (e.g. MAP_PRIVATE, MAP_ANONYMOUS, etc. for vma-&amp;gt;flags) are shown with names.&lt;br /&gt;
&lt;br /&gt;
; Device numbers&lt;br /&gt;
: If the field is known to be of &amp;lt;code&amp;gt;dev_t&amp;lt;/code&amp;gt; type, it's printed in the &amp;lt;code&amp;gt;major:minor&amp;lt;/code&amp;gt; manner&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images from IMG to JSON ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit decode&amp;lt;/code&amp;gt; is the replacement for the (rather nasty) &amp;lt;code&amp;gt;criu show&amp;lt;/code&amp;gt; code. This is also the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
Without &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-5679.img --pretty&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        1701145715, &lt;br /&gt;
                        3219568, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        33, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049520, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049632, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: &amp;amp;quot;0x7f172cf1ea04&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: &amp;amp;quot;0xffffffffffffffff&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: &amp;amp;quot;0x33&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: &amp;amp;quot;0x1200011&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: &amp;amp;quot;0x2355e00&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: &amp;amp;quot;0x7f172d83d9d0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: &amp;amp;quot;0x7f172d83d700&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf7530&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: &amp;amp;quot;0x2b&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: &amp;amp;quot;0x10002&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decode also supports input via STDIN instead of the &amp;quot;-i&amp;quot; flag. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;quot;core-5679.img&amp;quot; | crit decode &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Convert images from JSON to IMG ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit encode&amp;lt;/code&amp;gt; converts the image from JSON to IMG. Standard usage would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crit encode -i core-5679.json -o core-5679.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Encode also supports input via STDIN instead of the &amp;quot;-i&amp;quot; flag. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;quot;core-5679.json&amp;quot; | crit encode &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incase a &amp;quot;-o&amp;quot; flag is not specified the input is piped out to STDOUT.&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
Moved into separate project called [[criu-coredump]].&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit x&amp;lt;/code&amp;gt; allows you to explore image statistics.&lt;br /&gt;
E.g. Total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crit x $directory_with_images &amp;lt;explore type&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Supported explorers are&lt;br /&gt;
;'ps'&lt;br /&gt;
:to show process tree&lt;br /&gt;
&lt;br /&gt;
;'fds'&lt;br /&gt;
:to show files used by tasks&lt;br /&gt;
&lt;br /&gt;
;'mems'&lt;br /&gt;
:to show memory mappings info&lt;br /&gt;
&lt;br /&gt;
=== Show images Info ===&lt;br /&gt;
&lt;br /&gt;
Image of a info such as its &amp;quot;COUNT&amp;quot; and &amp;quot;MAGIC&amp;quot; can be displayed using the INFO command.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit info core-5679.img&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;count&amp;quot;: 1, &lt;br /&gt;
    &amp;quot;magic&amp;quot;: &amp;quot;CORE&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Planned functionality ==&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications. For details, see https://github.com/xemul/criu/issues/59.&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
For details, see https://github.com/xemul/criu/issues/44.&lt;br /&gt;
&lt;br /&gt;
=== [[Anonymize image files]] ===&lt;br /&gt;
&lt;br /&gt;
Since images contain raw memory dumps people may refuse to send us images for debugging. Need to anonymize them, i.e. -- remove this sensitive information.&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT_(Go_library)&amp;diff=5308</id>
		<title>CRIT (Go library)</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT_(Go_library)&amp;diff=5308"/>
		<updated>2022-08-12T09:01:02Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://github.com/checkpoint-restore/go-criu go-criu] provides a Go library based on [[CRIT]]. It supports encoding, decoding, and modification of CRIU images natively within Go code. It also ships with a CLI tool similar to the Python variant (not completely identical, see [[#Difference between Go and Python CLI]]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You can import the package into your Go project and use it like below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;import &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To build the CLI tool, run &amp;lt;code&amp;gt;make bin/crit&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;crit/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
Every operation requires a CRIT service instance. This can be created in two ways:&lt;br /&gt;
* &amp;lt;code&amp;gt;New()&amp;lt;/code&amp;gt;: Create a new service to use within a Go program. It does not support reading from stdin or printing to stdout, and is meant to be used purely non-interactively.&lt;br /&gt;
* &amp;lt;code&amp;gt;NewCli()&amp;lt;/code&amp;gt;: Create a new service to use as a CLI. It supports reading from stdin and printing to stdout if no file paths are provided, and can be used interactively.&lt;br /&gt;
&lt;br /&gt;
Both functions take the same parameters:&lt;br /&gt;
* Path of the input file&lt;br /&gt;
* Path of the output file&lt;br /&gt;
* Path of the input directory (for `crit explore`)&lt;br /&gt;
* Boolean to generate indented and multi-line JSON output&lt;br /&gt;
* Boolean to skip payload data&lt;br /&gt;
&lt;br /&gt;
The below operations are provided by the service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Decode() (*CriuImage, error)&lt;br /&gt;
    Info() (*CriuImage, error)&lt;br /&gt;
    Parse() (*CriuImage, error)&lt;br /&gt;
    Encode(*CriuImage) error&lt;br /&gt;
    ExplorePs() (*PsTree, error)&lt;br /&gt;
    ExploreFds() ([]*Fd, error)&lt;br /&gt;
    ExploreMems() ([]*MemMap, error)&lt;br /&gt;
    ExploreRss() ([]*RssMap, error)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Documentation about the types and methods provided by the library can be found [https://pkg.go.dev/github.com/checkpoint-restore/go-criu/v5/crit here].&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Here is a simple example of decoding &amp;lt;code&amp;gt;inventory.img&amp;lt;/code&amp;gt; and printing the image version:&lt;br /&gt;
&lt;br /&gt;
'''example.go'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package main&lt;br /&gt;
&lt;br /&gt;
import (&lt;br /&gt;
    &amp;quot;fmt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit&amp;quot;&lt;br /&gt;
    &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit/images&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
func main() {&lt;br /&gt;
    c := crit.New(&lt;br /&gt;
        &amp;quot;inventory.img&amp;quot;, /* input path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* output path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* input dir path (for Explore*()) */&lt;br /&gt;
        false, /* indenting for JSON */&lt;br /&gt;
        false, /* no payload */&lt;br /&gt;
    )&lt;br /&gt;
    img, err := c.Decode()&lt;br /&gt;
    if err != nil {&lt;br /&gt;
        fmt.Println(&amp;quot;Error: &amp;quot;, err)&lt;br /&gt;
    }&lt;br /&gt;
    imgVersion := img.(*images.InventoryEntry).GetImgVersion()&lt;br /&gt;
    fmt.Println(&amp;quot;Image version is &amp;quot;, imgVersion)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Difference between Go and Python CLI ==&lt;br /&gt;
* The Go CLI uses JSON as the standard output format for all commands, whereas the Python CLI uses custom formats for &amp;lt;code&amp;gt;crit explore&amp;lt;/code&amp;gt;. This results in different outputs for the same command, although the content remains the same.&lt;br /&gt;
* The Go JSON output uses &amp;lt;code&amp;gt;camelCase&amp;lt;/code&amp;gt; field names, whereas the Python CLI JSON output uses &amp;lt;code&amp;gt;snake_case&amp;lt;/code&amp;gt; field names.&lt;br /&gt;
&lt;br /&gt;
[[Category: Images]]&lt;br /&gt;
[[Category: API]]&lt;br /&gt;
[[Category: Go]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT_(Go_library)&amp;diff=5307</id>
		<title>CRIT (Go library)</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT_(Go_library)&amp;diff=5307"/>
		<updated>2022-08-12T09:00:24Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Fix indents&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://github.com/checkpoint-restore/go-criu go-criu] provides a Go library based on [[CRIT]]. It supports encoding, decoding, and modification of CRIU images natively within Go code. It also ships with a CLI tool similar to the Python variant (not completely identical, see [[#Difference between Go and Python CLI]]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You can import the package into your Go project and use it like below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;import &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To build the CLI tool, run &amp;lt;code&amp;gt;make bin/crit&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;crit/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
Every operation requires a CRIT service instance. This can be created in two ways:&lt;br /&gt;
* &amp;lt;code&amp;gt;New()&amp;lt;/code&amp;gt;: Create a new service to use within a Go program. It does not support reading from stdin or printing to stdout, and is meant to be used purely non-interactively.&lt;br /&gt;
* &amp;lt;code&amp;gt;NewCli()&amp;lt;/code&amp;gt;: Create a new service to use as a CLI. It supports reading from stdin and printing to stdout if no file paths are provided, and can be used interactively.&lt;br /&gt;
&lt;br /&gt;
Both functions take the same parameters:&lt;br /&gt;
* Path of the input file&lt;br /&gt;
* Path of the output file&lt;br /&gt;
* Path of the input directory (for `crit explore`)&lt;br /&gt;
* Boolean to generate indented and multi-line JSON output&lt;br /&gt;
* Boolean to skip payload data&lt;br /&gt;
&lt;br /&gt;
The below operations are provided by the service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Decode() (*CriuImage, error)&lt;br /&gt;
    Info() (*CriuImage, error)&lt;br /&gt;
    Parse() (*CriuImage, error)&lt;br /&gt;
    Encode(*CriuImage) error&lt;br /&gt;
    ExplorePs() (*PsTree, error)&lt;br /&gt;
    ExploreFds() ([]*Fd, error)&lt;br /&gt;
    ExploreMems() ([]*MemMap, error)&lt;br /&gt;
    ExploreRss() ([]*RssMap, error)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Documentation about the types and methods provided by the library can be found [https://pkg.go.dev/github.com/checkpoint-restore/go-criu/v5/crit here].&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Here is a simple example of decoding &amp;lt;code&amp;gt;inventory.img&amp;lt;/code&amp;gt; and printing the image version:&lt;br /&gt;
&lt;br /&gt;
'''example.go'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package main&lt;br /&gt;
&lt;br /&gt;
import (&lt;br /&gt;
    &amp;quot;fmt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit&amp;quot;&lt;br /&gt;
    &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit/images&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
func main() {&lt;br /&gt;
    c := crit.New(&lt;br /&gt;
        &amp;quot;inventory.img&amp;quot;, /* input path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* output path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* input dir path (for Explore*()) */&lt;br /&gt;
        false, /* indenting for JSON */&lt;br /&gt;
        false, /* no payload */&lt;br /&gt;
    )&lt;br /&gt;
    img, err := c.Decode()&lt;br /&gt;
    if err != nil {&lt;br /&gt;
        fmt.Println(&amp;quot;Error: &amp;quot;, err)&lt;br /&gt;
    }&lt;br /&gt;
    imgVersion := img.(*images.InventoryEntry).GetImgVersion()&lt;br /&gt;
    fmt.Println(&amp;quot;Image version is &amp;quot;, imgVersion)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Difference between Go and Python CLI ==&lt;br /&gt;
* The Go CLI uses JSON as the standard output format for all commands, whereas the Python CLI uses custom formats for &amp;lt;code&amp;gt;crit explore&amp;lt;/code&amp;gt;. This results in different outputs for the same command, although the content remains the same.&lt;br /&gt;
* The Go JSON output uses &amp;lt;code&amp;gt;camelCased&amp;lt;/code&amp;gt; field names, whereas the Python CLI JSON output uses &amp;lt;code&amp;gt;snake_case&amp;lt;/code&amp;gt; field names.&lt;br /&gt;
&lt;br /&gt;
[[Category: Images]]&lt;br /&gt;
[[Category: API]]&lt;br /&gt;
[[Category: Go]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Category:Go&amp;diff=5306</id>
		<title>Category:Go</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Category:Go&amp;diff=5306"/>
		<updated>2022-08-12T08:55:40Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=5305</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=5305"/>
		<updated>2022-08-12T08:53:07Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Add link to Go library&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This page describes the CRIT Python tool. For the Go library, see [[CRIT (Go library)]]''&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool is a feature-rich replacement for existing &amp;quot;criu show&amp;quot;.&lt;br /&gt;
It is written completely in Python, so it is quite easy to read the code and extend its features.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] {decode,encode,info,x,show} ...&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode,info,x,show}&lt;br /&gt;
                        Use crit CMD --help for command-specific help&lt;br /&gt;
    decode              convert criu image from binary type to json&lt;br /&gt;
    encode              convert criu image from json type to binary&lt;br /&gt;
    info                show info about image&lt;br /&gt;
    x                   explore image dir&lt;br /&gt;
    show                convert criu image from binary to human-readable json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pretty output ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit decode&amp;lt;/code&amp;gt; prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. CRIT can do this when using the &amp;lt;code&amp;gt;show&amp;lt;/code&amp;gt; action or the &amp;lt;code&amp;gt;--pretty&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
Wend doing pretty optput CRIT does a little bit more, than just multiline indented JSON.&lt;br /&gt;
&lt;br /&gt;
; Addresses and registers&lt;br /&gt;
: VM addresses and core.img register values are all printed in hex. Since JSON doesn't support this form of numbers, such fields are encoded as strings.&lt;br /&gt;
&lt;br /&gt;
; Bit-fields&lt;br /&gt;
: Such things as flags and masks (e.g. sig-block mask) are also better understood when written in hex, so CRIT does this.&lt;br /&gt;
&lt;br /&gt;
; IP addresses&lt;br /&gt;
: By default those a printed in decimal, but the &amp;quot;1.2.3.4&amp;quot; for v4 or &amp;quot;::1&amp;quot; for v6 can be seen in the --pretty mode.&lt;br /&gt;
&lt;br /&gt;
; Symbolic names for flags&lt;br /&gt;
: Some known bit sets (e.g. MAP_PRIVATE, MAP_ANONYMOUS, etc. for vma-&amp;gt;flags) are shown with names.&lt;br /&gt;
&lt;br /&gt;
; Device numbers&lt;br /&gt;
: If the field is known to be of &amp;lt;code&amp;gt;dev_t&amp;lt;/code&amp;gt; type, it's printed in the &amp;lt;code&amp;gt;major:minor&amp;lt;/code&amp;gt; manner&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images from IMG to JSON ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit decode&amp;lt;/code&amp;gt; is the replacement for the (rather nasty) &amp;lt;code&amp;gt;criu show&amp;lt;/code&amp;gt; code. This is also the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
Without &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-5679.img --pretty&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        1701145715, &lt;br /&gt;
                        3219568, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        33, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049520, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049632, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: &amp;amp;quot;0x7f172cf1ea04&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: &amp;amp;quot;0xffffffffffffffff&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: &amp;amp;quot;0x33&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: &amp;amp;quot;0x1200011&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: &amp;amp;quot;0x2355e00&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: &amp;amp;quot;0x7f172d83d9d0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: &amp;amp;quot;0x7f172d83d700&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf7530&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: &amp;amp;quot;0x2b&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: &amp;amp;quot;0x10002&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decode also supports input via STDIN instead of the &amp;quot;-i&amp;quot; flag. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;quot;core-5679.img&amp;quot; | crit decode &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Convert images from JSON to IMG ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit encode&amp;lt;/code&amp;gt; converts the image from JSON to IMG. Standard usage would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crit encode -i core-5679.json -o core-5679.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Encode also supports input via STDIN instead of the &amp;quot;-i&amp;quot; flag. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;quot;core-5679.json&amp;quot; | crit encode &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incase a &amp;quot;-o&amp;quot; flag is not specified the input is piped out to STDOUT.&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
Moved into separate project called [[criu-coredump]].&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit x&amp;lt;/code&amp;gt; allows you to explore image statistics.&lt;br /&gt;
E.g. Total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crit x $directory_with_images &amp;lt;explore type&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Supported explorers are&lt;br /&gt;
;'ps'&lt;br /&gt;
:to show process tree&lt;br /&gt;
&lt;br /&gt;
;'fds'&lt;br /&gt;
:to show files used by tasks&lt;br /&gt;
&lt;br /&gt;
;'mems'&lt;br /&gt;
:to show memory mappings info&lt;br /&gt;
&lt;br /&gt;
=== Show images Info ===&lt;br /&gt;
&lt;br /&gt;
Image of a info such as its &amp;quot;COUNT&amp;quot; and &amp;quot;MAGIC&amp;quot; can be displayed using the INFO command.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit info core-5679.img&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;count&amp;quot;: 1, &lt;br /&gt;
    &amp;quot;magic&amp;quot;: &amp;quot;CORE&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Planned functionality ==&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications. For details, see https://github.com/xemul/criu/issues/59.&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
For details, see https://github.com/xemul/criu/issues/44.&lt;br /&gt;
&lt;br /&gt;
=== [[Anonymize image files]] ===&lt;br /&gt;
&lt;br /&gt;
Since images contain raw memory dumps people may refuse to send us images for debugging. Need to anonymize them, i.e. -- remove this sensitive information.&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT_(Go_library)&amp;diff=5304</id>
		<title>CRIT (Go library)</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT_(Go_library)&amp;diff=5304"/>
		<updated>2022-08-12T08:48:33Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Fix broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://github.com/checkpoint-restore/go-criu go-criu] provides a Go library based on [[CRIT]]. It supports encoding, decoding, and modification of CRIU images natively within Go code. It also ships with a CLI tool similar to the Python variant (not completely identical, see [[#Difference between Go and Python CLI]]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You can import the package into your Go project and use it like below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;import &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To build the CLI tool, run &amp;lt;code&amp;gt;make bin/crit&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;crit/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
Every operation requires a CRIT service instance. This can be created in two ways:&lt;br /&gt;
* &amp;lt;code&amp;gt;New()&amp;lt;/code&amp;gt;: Create a new service to use within a Go program. It does not support reading from stdin or printing to stdout, and is meant to be used purely non-interactively.&lt;br /&gt;
* &amp;lt;code&amp;gt;NewCli()&amp;lt;/code&amp;gt;: Create a new service to use as a CLI. It supports reading from stdin and printing to stdout if no file paths are provided, and can be used interactively.&lt;br /&gt;
&lt;br /&gt;
Both functions take the same parameters:&lt;br /&gt;
* Path of the input file&lt;br /&gt;
* Path of the output file&lt;br /&gt;
* Path of the input directory (for `crit explore`)&lt;br /&gt;
* Boolean to generate indented and multi-line JSON output&lt;br /&gt;
* Boolean to skip payload data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;go&amp;quot;&amp;gt;&lt;br /&gt;
    c := crit.New(&lt;br /&gt;
        &amp;quot;inventory.img&amp;quot;, /* input path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* output path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* input dir path (for Explore*()) */&lt;br /&gt;
        false, /* indenting for JSON */&lt;br /&gt;
        false, /* no payload */&lt;br /&gt;
    )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The below operations are provided by the service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;go&amp;quot;&amp;gt;&lt;br /&gt;
	Decode() (*CriuImage, error)&lt;br /&gt;
	Info() (*CriuImage, error)&lt;br /&gt;
	Parse() (*CriuImage, error)&lt;br /&gt;
	Encode(*CriuImage) error&lt;br /&gt;
	ExplorePs() (*PsTree, error)&lt;br /&gt;
	ExploreFds() ([]*Fd, error)&lt;br /&gt;
	ExploreMems() ([]*MemMap, error)&lt;br /&gt;
	ExploreRss() ([]*RssMap, error)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Documentation about the types and methods provided by the library can be found [https://pkg.go.dev/github.com/checkpoint-restore/go-criu/v5/crit here].&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Here is a simple example of decoding &amp;lt;code&amp;gt;inventory.img&amp;lt;/code&amp;gt; and printing the image version:&lt;br /&gt;
&lt;br /&gt;
'''example.go'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;go&amp;quot;&amp;gt;&lt;br /&gt;
package main&lt;br /&gt;
&lt;br /&gt;
import (&lt;br /&gt;
    &amp;quot;fmt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit&amp;quot;&lt;br /&gt;
    &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit/images&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
func main() {&lt;br /&gt;
    c := crit.New(&lt;br /&gt;
        &amp;quot;inventory.img&amp;quot;, /* input path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* output path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* input dir path (for Explore*()) */&lt;br /&gt;
        false, /* indenting for JSON */&lt;br /&gt;
        false, /* no payload */&lt;br /&gt;
    )&lt;br /&gt;
    img, err := c.Decode()&lt;br /&gt;
    if err != nil {&lt;br /&gt;
        fmt.Println(&amp;quot;Error: &amp;quot;, err)&lt;br /&gt;
    }&lt;br /&gt;
    imgVersion := img.(*images.InventoryEntry).GetImgVersion()&lt;br /&gt;
    fmt.Println(&amp;quot;Image version is &amp;quot;, imgVersion)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Difference between Go and Python CLI ==&lt;br /&gt;
* The Go CLI uses JSON as the standard output format for all commands, whereas the Python CLI uses custom formats for &amp;lt;code&amp;gt;crit explore&amp;lt;/code&amp;gt;. This results in different outputs for the same command, although the content remains the same.&lt;br /&gt;
* The Go JSON output uses camelCased field names, whereas the Python CLI JSON output uses snake_case field names.&lt;br /&gt;
&lt;br /&gt;
[[Category: Images]]&lt;br /&gt;
[[Category: API]]&lt;br /&gt;
[[Category: Go]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT_(Go_library)&amp;diff=5303</id>
		<title>CRIT (Go library)</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT_(Go_library)&amp;diff=5303"/>
		<updated>2022-08-12T08:46:49Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Create page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://github.com/checkpoint-restore/go-criu go-criu] provides a Go library based on [[CRIT]]. It supports encoding, decoding, and modification of CRIU images natively within Go code. It also ships with a CLI tool similar to the Python variant (not completely identical, see [[#Difference between Go and Python CLI]]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You can import the package into your Go project and use it like below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;import &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To build the CLI tool, run &amp;lt;code&amp;gt;make bin/crit&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;crit/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
Every operation requires a CRIT service instance. This can be created in two ways:&lt;br /&gt;
* &amp;lt;code&amp;gt;New()&amp;lt;/code&amp;gt;: Create a new service to use within a Go program. It does not support reading from stdin or printing to stdout, and is meant to be used purely non-interactively.&lt;br /&gt;
* &amp;lt;code&amp;gt;NewCli()&amp;lt;/code&amp;gt;: Create a new service to use as a CLI. It supports reading from stdin and printing to stdout if no file paths are provided, and can be used interactively.&lt;br /&gt;
&lt;br /&gt;
Both functions take the same parameters:&lt;br /&gt;
* Path of the input file&lt;br /&gt;
* Path of the output file&lt;br /&gt;
* Path of the input directory (for `crit explore`)&lt;br /&gt;
* Boolean to generate indented and multi-line JSON output&lt;br /&gt;
* Boolean to skip payload data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;go&amp;quot;&amp;gt;&lt;br /&gt;
    c := crit.New(&lt;br /&gt;
        &amp;quot;inventory.img&amp;quot;, /* input path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* output path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* input dir path (for Explore*()) */&lt;br /&gt;
        false, /* indenting for JSON */&lt;br /&gt;
        false, /* no payload */&lt;br /&gt;
    )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The below operations are provided by the service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;go&amp;quot;&amp;gt;&lt;br /&gt;
	Decode() (*CriuImage, error)&lt;br /&gt;
	Info() (*CriuImage, error)&lt;br /&gt;
	Parse() (*CriuImage, error)&lt;br /&gt;
	Encode(*CriuImage) error&lt;br /&gt;
	ExplorePs() (*PsTree, error)&lt;br /&gt;
	ExploreFds() ([]*Fd, error)&lt;br /&gt;
	ExploreMems() ([]*MemMap, error)&lt;br /&gt;
	ExploreRss() ([]*RssMap, error)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Documentation about the types and methods provided by the library can be found [https://pkg.go.dev/github.com/checkpoint-restore/go-criu/v5/crit|here]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Here is a simple example of decoding &amp;lt;code&amp;gt;inventory.img&amp;lt;/code&amp;gt; and printing the image version:&lt;br /&gt;
&lt;br /&gt;
'''example.go'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;go&amp;quot;&amp;gt;&lt;br /&gt;
package main&lt;br /&gt;
&lt;br /&gt;
import (&lt;br /&gt;
    &amp;quot;fmt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit&amp;quot;&lt;br /&gt;
    &amp;quot;github.com/checkpoint-restore/go-criu/v6/crit/images&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
func main() {&lt;br /&gt;
    c := crit.New(&lt;br /&gt;
        &amp;quot;inventory.img&amp;quot;, /* input path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* output path */&lt;br /&gt;
        &amp;quot;&amp;quot;, /* input dir path (for Explore*()) */&lt;br /&gt;
        false, /* indenting for JSON */&lt;br /&gt;
        false, /* no payload */&lt;br /&gt;
    )&lt;br /&gt;
    img, err := c.Decode()&lt;br /&gt;
    if err != nil {&lt;br /&gt;
        fmt.Println(&amp;quot;Error: &amp;quot;, err)&lt;br /&gt;
    }&lt;br /&gt;
    imgVersion := img.(*images.InventoryEntry).GetImgVersion()&lt;br /&gt;
    fmt.Println(&amp;quot;Image version is &amp;quot;, imgVersion)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Difference between Go and Python CLI ==&lt;br /&gt;
* The Go CLI uses JSON as the standard output format for all commands, whereas the Python CLI uses custom formats for &amp;lt;code&amp;gt;crit explore&amp;lt;/code&amp;gt;. This results in different outputs for the same command, although the content remains the same.&lt;br /&gt;
* The Go JSON output uses camelCased field names, whereas the Python CLI JSON output uses snake_case field names.&lt;br /&gt;
&lt;br /&gt;
[[Category: Images]]&lt;br /&gt;
[[Category: API]]&lt;br /&gt;
[[Category: Go]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=5292</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=5292"/>
		<updated>2022-05-26T18:33:51Z</updated>

		<summary type="html">&lt;p&gt;Prajwal S N: Fixed a bunch of typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool. CRIT is a feature-rich replacement for existing &amp;quot;criu show&amp;quot;.&lt;br /&gt;
It is written completely in Python, so it is quite easy to read the code and extend its features.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] {decode,encode,info,x,show} ...&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode,info,x,show}&lt;br /&gt;
                        Use crit CMD --help for command-specific help&lt;br /&gt;
    decode              convert criu image from binary type to json&lt;br /&gt;
    encode              convert criu image from json type to binary&lt;br /&gt;
    info                show info about image&lt;br /&gt;
    x                   explore image dir&lt;br /&gt;
    show                convert criu image from binary to human-readable json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pretty output ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit decode&amp;lt;/code&amp;gt; prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. CRIT can do this when using the &amp;lt;code&amp;gt;show&amp;lt;/code&amp;gt; action or the &amp;lt;code&amp;gt;--pretty&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
Wend doing pretty optput CRIT does a little bit more, than just multiline indented JSON.&lt;br /&gt;
&lt;br /&gt;
; Addresses and registers&lt;br /&gt;
: VM addresses and core.img register values are all printed in hex. Since JSON doesn't support this form of numbers, such fields are encoded as strings.&lt;br /&gt;
&lt;br /&gt;
; Bit-fields&lt;br /&gt;
: Such things as flags and masks (e.g. sig-block mask) are also better understood when written in hex, so CRIT does this.&lt;br /&gt;
&lt;br /&gt;
; IP addresses&lt;br /&gt;
: By default those a printed in decimal, but the &amp;quot;1.2.3.4&amp;quot; for v4 or &amp;quot;::1&amp;quot; for v6 can be seen in the --pretty mode.&lt;br /&gt;
&lt;br /&gt;
; Symbolic names for flags&lt;br /&gt;
: Some known bit sets (e.g. MAP_PRIVATE, MAP_ANONYMOUS, etc. for vma-&amp;gt;flags) are shown with names.&lt;br /&gt;
&lt;br /&gt;
; Device numbers&lt;br /&gt;
: If the field is known to be of &amp;lt;code&amp;gt;dev_t&amp;lt;/code&amp;gt; type, it's printed in the &amp;lt;code&amp;gt;major:minor&amp;lt;/code&amp;gt; manner&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images from IMG to JSON ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit decode&amp;lt;/code&amp;gt; is the replacement for the (rather nasty) &amp;lt;code&amp;gt;criu show&amp;lt;/code&amp;gt; code. This is also the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
Without &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-5679.img --pretty&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        1701145715, &lt;br /&gt;
                        3219568, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        33, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049520, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049632, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: &amp;amp;quot;0x7f172cf1ea04&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: &amp;amp;quot;0xffffffffffffffff&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: &amp;amp;quot;0x33&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: &amp;amp;quot;0x1200011&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: &amp;amp;quot;0x2355e00&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: &amp;amp;quot;0x7f172d83d9d0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: &amp;amp;quot;0x7f172d83d700&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf7530&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: &amp;amp;quot;0x2b&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: &amp;amp;quot;0x10002&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decode also supports input via STDIN instead of the &amp;quot;-i&amp;quot; flag. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;quot;core-5679.img&amp;quot; | crit decode &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Convert images from JSON to IMG ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit encode&amp;lt;/code&amp;gt; converts the image from JSON to IMG. Standard usage would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crit encode -i core-5679.json -o core-5679.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Encode also supports input via STDIN instead of the &amp;quot;-i&amp;quot; flag. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;quot;core-5679.json&amp;quot; | crit encode &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incase a &amp;quot;-o&amp;quot; flag is not specified the input is piped out to STDOUT.&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
Moved into separate project called [[criu-coredump]].&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;crit x&amp;lt;/code&amp;gt; allows you to explore image statistics.&lt;br /&gt;
E.g. Total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crit x $directory_with_images &amp;lt;explore type&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Supported explorers are&lt;br /&gt;
;'ps'&lt;br /&gt;
:to show process tree&lt;br /&gt;
&lt;br /&gt;
;'fds'&lt;br /&gt;
:to show files used by tasks&lt;br /&gt;
&lt;br /&gt;
;'mems'&lt;br /&gt;
:to show memory mappings info&lt;br /&gt;
&lt;br /&gt;
=== Show images Info ===&lt;br /&gt;
&lt;br /&gt;
Image of a info such as its &amp;quot;COUNT&amp;quot; and &amp;quot;MAGIC&amp;quot; can be displayed using the INFO command.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit info core-5679.img&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;count&amp;quot;: 1, &lt;br /&gt;
    &amp;quot;magic&amp;quot;: &amp;quot;CORE&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Planned functionality ==&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications. For details, see https://github.com/xemul/criu/issues/59.&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
For details, see https://github.com/xemul/criu/issues/44.&lt;br /&gt;
&lt;br /&gt;
=== [[Anonymize image files]] ===&lt;br /&gt;
&lt;br /&gt;
Since images contain raw memory dumps people may refuse to send us images for debugging. Need to anonymize them, i.e. -- remove this sensitive information.&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Prajwal S N</name></author>
	</entry>
</feed>