Control: reassign -1 apt Control: retitle -1 apt: Leaks file descriptors to child processes [ Leaving the whole message for context. ] Hi! On Sun, 2014-11-02 at 18:19:01 +0100, Ivanov Niechta wrote: > Package: dpkg > Version: 1.17.13 > When i install a new kernel, > > The code is not setting for the clone-on-exec for the file descriptor ? Yes, apt seems to be missing that on some of the file descriptors it sets up. See below for a test case: > root@vaio:/home/ivanov# apt-get install linux-image-3.16-3-amd64 > Lecture des listes de paquets... Fait > Construction de l'arbre des dépendances > Lecture des informations d'état... Fait > Paquets suggérés : > linux-doc-3.16 debian-kernel-handbook > Les NOUVEAUX paquets suivants seront installés : > linux-image-3.16-3-amd64 > 0 mis à jour, 1 nouvellement installés, 0 à enlever et 0 non mis à jour. > Il est nécessaire de prendre 0 o/33,6 Mo dans les archives. > Après cette opération, 164 Mo d'espace disque supplémentaires seront > utilisés. > Préconfiguration des paquets... > Sélection du paquet linux-image-3.16-3-amd64 précédemment désélectionné. > (Lecture de la base de données... 147668 fichiers et répertoires déjà > installés.) > Préparation du dépaquetage de > .../linux-image-3.16-3-amd64_3.16.5-1_amd64.deb ... > Dépaquetage de linux-image-3.16-3-amd64 (3.16.5-1) ... > Paramétrage de linux-image-3.16-3-amd64 (3.16.5-1) ... > /etc/kernel/postinst.d/dkms: > Error! Your kernel headers for kernel 3.16-3-amd64 cannot be found. > Please install the linux-headers-3.16-3-amd64 package, > or use the --kernelsourcedir option to tell DKMS where it's located > Error! Your kernel headers for kernel 3.16-3-amd64 cannot be found. > Please install the linux-headers-3.16-3-amd64 package, > or use the --kernelsourcedir option to tell DKMS where it's located > /etc/kernel/postinst.d/initramfs-tools: > update-initramfs: Generating /boot/initrd.img-3.16-3-amd64 > /etc/kernel/postinst.d/zz-update-grub: > Création du fichier de configuration GRUB… > Found background image: .background_cache.png > File descriptor 20 (/dev/pts/3) leaked on vgs invocation. Parent PID 8232: > /usr/sbin/grub-probe > File descriptor 20 (/dev/pts/3) leaked on vgs invocation. Parent PID 8232: > /usr/sbin/grub-probe > erreur : impossible de parcourir « /dev/mapper/md0_crypt » : Argument > invalide. > erreur : impossible de parcourir « /dev/mapper/md0_crypt » : Argument > invalide. > erreur : impossible de parcourir « /dev/mapper/md0_crypt » : Argument > invalide. > erreur : impossible de parcourir « /dev/mapper/md0_crypt » : Argument > invalide. > Image Linux trouvée : /boot/vmlinuz-3.16-3-amd64 > Image mémoire initiale trouvée : /boot/initrd.img-3.16-3-amd64 > Image Linux trouvée : /boot/vmlinuz-3.13-1-amd64 > Image mémoire initiale trouvée : /boot/initrd.img-3.13-1-amd64 > Image Linux trouvée : /boot/vmlinuz-3.2.0-4-amd64 > Image mémoire initiale trouvée : /boot/initrd.img-3.2.0-4-amd64 > File descriptor 20 (/dev/pts/3) leaked on vgs invocation. Parent PID 8761: > /usr/sbin/grub-probe > File descriptor 20 (/dev/pts/3) leaked on vgs invocation. Parent PID 8761: > /usr/sbin/grub-probe > erreur : impossible de parcourir « /dev/mapper/md0_crypt » : Argument > invalide. > erreur : impossible de parcourir « /dev/mapper/md0_crypt » : Argument > invalide. > erreur : impossible de parcourir « /dev/mapper/md0_crypt » : Argument > invalide. > erreur : impossible de parcourir « /dev/mapper/md0_crypt » : Argument > invalide. > File descriptor 20 (/dev/pts/3) leaked on lvs invocation. Parent PID 8946: > /bin/sh > fait With the attached package, built with: $ dpkg-deb -b pkg-maintscript-leak pkg-maintscript-leak.deb doing: # dpkg -i pkg-maintscript-leak.deb Selecting previously unselected package pkg-maintscript-leak. (Reading database ... 225380 files and directories currently installed.) Preparing to unpack pkg-maintscript-leak.deb ... total 0 lrwx------ 1 root root 64 Nov 6 07:51 0 -> /dev/pts/3 lrwx------ 1 root root 64 Nov 6 07:51 1 -> /dev/pts/3 lrwx------ 1 root root 64 Nov 6 07:51 2 -> /dev/pts/3 lr-x------ 1 root root 64 Nov 6 07:51 3 -> /proc/26144/fd Unpacking pkg-maintscript-leak (0) ... Setting up pkg-maintscript-leak (0) ... total 0 lrwx------ 1 root root 64 Nov 6 07:51 0 -> /dev/pts/3 lrwx------ 1 root root 64 Nov 6 07:51 1 -> /dev/pts/3 lrwx------ 1 root root 64 Nov 6 07:51 2 -> /dev/pts/3 lr-x------ 1 root root 64 Nov 6 07:51 3 -> /proc/26150/fd does not leak file descriptors, the first three are stdin, stdout and stderr, the other one is an fd for the /proc/self/fd/ directory. But doing: # apt install pkg-maintscript-leak.deb […] Selecting previously unselected package pkg-maintscript-leak. (Reading database ... 225380 files and directories currently installed.) Preparing to unpack .../pkg-maintscript-leak.deb ... total 0 lrwx------ 1 root root 64 Nov 6 07:59 0 -> /dev/pts/14 lrwx------ 1 root root 64 Nov 6 07:59 1 -> /dev/pts/14 lrwx------ 1 root root 64 Nov 6 07:59 2 -> /dev/pts/14 lrwx------ 1 root root 64 Nov 6 07:59 27 -> /dev/pts/14 lr-x------ 1 root root 64 Nov 6 07:59 3 -> /proc/26425/fd Unpacking pkg-maintscript-leak (0) ... Setting up pkg-maintscript-leak (0) ... total 0 lrwx------ 1 root root 64 Nov 6 07:59 0 -> /dev/pts/14 lrwx------ 1 root root 64 Nov 6 07:59 1 -> /dev/pts/14 lrwx------ 1 root root 64 Nov 6 07:59 2 -> /dev/pts/14 lrwx------ 1 root root 64 Nov 6 07:59 27 -> /dev/pts/14 lr-x------ 1 root root 64 Nov 6 07:59 3 -> /proc/26432/fd does have an additional fd, which was leaked. Thanks, Guillem
Attachment:
pkg-maintscript-leak.tar.xz
Description: application/xz