Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Enable CONFIG_UNIX_DIAG (=m) so CRIU can checkpoint processes that use unix sockets

Ouverte Adaptée aux débutants
#7,718 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
63/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
c, linux

Piste de recherche

Commencez par lire les fichiers de configuration du noyau pour les cibles Raspberry Pi 64 bits qui activent déjà CONFIG_CHECKPOINT_RESTORE, puis vérifiez comment les options Unix socket voisines sont configurées. Activez CONFIG_UNIX_DIAG en tant que module pour les cibles concernées. Compilez le noyau et vérifiez que le module est disponible et que CRIU peut sauvegarder et restaurer un processus qui détient un socket Unix.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Motivation

I'm working toward backing up and restoring a desktop session on a Pi 500: the Wayland session, Chromium and other GUI apps. The Pi 500 has no working suspend-to-RAM (/sys/power/state is empty and CONFIG_SUSPEND is not set), so checkpoint/restore is the only route to "come back exactly as left" after a power-off.

Unix sockets are the first thing in the way. Wayland, D-Bus, PipeWire and the Chromium process tree all communicate over them, so CRIU can't even start on a GUI session without unix_diag. I know it won't be enough on its own, since DRM/GPU file descriptors are a separate gap in CRIU. But it unblocks everything that doesn't touch the GPU (terminal sessions, shells, daemons), and it is a prerequisite for any further progress on the GUI side.

Describe the bug

CONFIG_CHECKPOINT_RESTORE=y has been enabled since #5516, but CRIU still can't dump any process that holds a unix socket, because CONFIG_UNIX_DIAG is not set. CRIU finds unix sockets (and their peers) through the sock_diag netlink interface, so without it the dump fails:

Error (criu/sockets.c:210): sockets: Diag module missing (-2)
Error (criu/sockets.c:436): sockets: Sockets (family 1 proto 0) are not collected
Error (criu/sk-unix.c:351): unix: Unix socket 5452475 not found
Error (criu/cr-dump.c:2111): Dumping FAILED.

In practice this rules out checkpointing nearly any real process: tmux, shells with a D-Bus or agent socket, and most daemons. Only socket-free processes work today.

I'm asking for CONFIG_UNIX_DIAG=m, which Debian and Ubuntu kernels already set. It adds one small module (net/unix/diag.c, about 330 lines) and doesn't change the built-in af_unix code. It is not loaded unless something requests it.

Evidence that this is all that is missing for unix sockets

I built net/unix/diag.c from rpi-6.18.y as an out-of-tree module against the stock 6.18.50 headers, with no other change, and loaded it. With it loaded, CRIU 4.1.1 works on the otherwise unmodified kernel:

  • A process with a socketpair: dumped, killed and restored, and it continued from where it was.
  • A detached tmux server (its listening unix socket, a pty and a child shell running a counter): dumped, killed and restored. The session was back in tmux ls and the counter resumed.

The exports af_unix.c needs (unix_peer_get, unix_inq_len/unix_outq_len, and others) are already present in the stock kernel, so there are no source changes outside the new module.

Optional, lower priority

criu check --all also reports UFFD is not supported (CONFIG_USERFAULTFD not set) and Dirty tracking is OFF. These only affect lazy restore and incremental dumps, so basic checkpoint/restore doesn't need them. I'd leave them for a separate discussion.

Steps to reproduce the behaviour
sudo apt install criu
python3 -c 'import socket,time; a,b=socket.socketpair(); time.sleep(1e6)' &
sudo criu dump -t $! -D /tmp/d --shell-job     # fails as above
# build and insmod unix_diag.ko from net/unix/diag.c, then repeat: it succeeds
Device (s)

Raspberry Pi 500 (this should apply to every 64-bit target that already has CHECKPOINT_RESTORE)

System
Raspberry Pi reference 2026-06-18
Linux pi500 6.18.50+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.18.50-1+rpt1 (2026-09-11) aarch64
vcgencmd version: f5e89631 (release) (embedded), 2026/08/12
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_UNIX_DIAG is not set
Additional context

Same request pattern as #5516 (CHECKPOINT_RESTORE), which pelwell added to the defconfig after measuring no performance cost. A module-only option should cost even less.

Langage dominant
C
Étoiles
13.3k
Forks
5.5k
Merge moyen
1 j 2 h
PR mergées (30 j)
24

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de raspberrypi/linux

Toutes les issues de raspberrypi/linux

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.