
PoC d'exploitation pour CVE-2022-29968 par Joseph Ravichandran et Michael Wang
Exploit de preuve de concept pour CVE-2022-29968 (mémoire non initialisée) dans le noyau Linux, en particulier le sous-système io_uring.
Le crash a été découvert avec Syzkaller. Il a été analysé par Joseph Ravichandran et Michael Wang. L'exploit a été écrit par Joseph Ravichandran.
Nous avons découvert et signalé ce bogue dans le cadre du projet final pour 6.858 au MIT, printemps 2022.
Tout noyau après 3e08773c3841 ("block: switch polling to be bio based") et avant 32452a3eb8b6 ("io_uring: fix uninitialized field in rw io_kiocb") devrait être vulnérable à cela.
Le rapport que nous avons soumis pour le projet final 6.858
/dev/sr0 doit pouvoir être lu par un utilisateur non privilégiéTesté dans une installation Busybox (sans KVM) avec 128 Mo de RAM :
$QEMU -m 128M -kernel $KERNEL -initrd $INITRD -nographic -append "console=ttyS0 nokaslr no_hash_pointers ftrace_dump_on_oops"
initramfs init :
#!/bin/sh
/bin/busybox --install -s
# Mount required file systems (very useful if you are using ftrace/ debug features)
mount -t proc none /proc
mount -t sysfs sysfs /sys
mount -t tracefs nodev /sys/kernel/tracing
mount -t debugfs none /sys/kernel/debug
mkdir -p /tmp && mount -t tmpfs tmpfs /tmp
mount -t devtmpfs none /dev
# Setup permissions for sr0
chmod -R 0777 /dev/sr0
# Create a temp file (used by the old userfaultfd approach)
# Not needed for the public exploit
touch /tmp/test
# Switch to non-root user
su attacker
# Run shell
exec sh
# Run shell (except ^C now works)
#exec setsid sh -c 'exec sh </dev/ttyS0 >/dev/ttyS0 2>&1'
Notre etc/passwd contient un utilisateur non root (attacker) et un utilisateur root (root) :
attacker:x:1000:1000:Linux User,,,:/home/attacker:/bin/sh
root:x:0:0:root:/tmp:/bin/sh
Le noyau a été compilé avec make defconfig pour x86_64 avec quelques fonctionnalités de traçage/débogage supplémentaires activées.
make./spray./exploit