
Exploit PoC per CVE-2022-29968 di Joseph Ravichandran e Michael Wang
Exploit proof-of-concept per CVE-2022-29968 (memoria non inizializzata) nel kernel Linux, in particolare il sistema io_uring.
Il crash è stato trovato con Syzkaller. Il crash è stato analizzato da Joseph Ravichandran e Michael Wang. L'exploit è stato scritto da Joseph Ravichandran.
Abbiamo trovato e segnalato questo bug come parte del progetto finale per 6.858 al MIT, Primavera 2022.
Qualsiasi kernel dopo 3e08773c3841 ("block: switch polling to be bio based") e prima di 32452a3eb8b6 ("io_uring: fix uninitialized field in rw io_kiocb") dovrebbe essere vulnerabile a questo.
L'analisi che abbiamo presentato per il progetto finale di 6.858
/dev/sr0 deve essere leggibile da un utente non privilegiatoTestato in un installazione Busybox (senza KVM) con 128M di 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'
Il nostro etc/passwd ha un utente non-root (attacker) e un utente root (root):
attacker:x:1000:1000:Linux User,,,:/home/attacker:/bin/sh
root:x:0:0:root:/tmp:/bin/sh
Il kernel è stato compilato con make defconfig per x86_64 con alcune funzionalità extra di tracing/debugging abilitate.
make./spray./exploit