
Exploit PoC para CVE-2022-29968 por Joseph Ravichandran e Michael Wang
Exploit de prova de conceito para CVE-2022-29968 (memória não inicializada) no Kernel Linux, especificamente o sistema io_uring.
O crash foi encontrado com o Syzkaller. O crash foi analisado por Joseph Ravichandran e Michael Wang. O exploit foi escrito por Joseph Ravichandran.
Encontramos e reportamos este bug como parte do projeto final para 6.858 no MIT, Spring 2022.
Qualquer kernel após 3e08773c3841 ("block: switch polling to be bio based") e antes de 32452a3eb8b6 ("io_uring: fix uninitialized field in rw io_kiocb") deve ser vulnerável a isso.
O artigo que submetemos para o projeto final de 6.858
/dev/sr0 precisa ser legível por um usuário não privilegiadoTestado em uma instalação Busybox (sem KVM) com 128M 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'
Nosso etc/passwd tem um usuário não root (attacker) e um usuário root (root):
attacker:x:1000:1000:Linux User,,,:/home/attacker:/bin/sh
root:x:0:0:root:/tmp:/bin/sh
O kernel foi compilado com make defconfig para x86_64 com alguns recursos extras de rastreamento/depuração ativados.
make./spray./exploit