
CVE-2022-29968에 대한 익스플로잇 PoC - Joseph Ravichandran 및 Michael Wang 작성
CVE-2022-29968에 대한 개념 증명 익스플로잇입니다. Linux 커널, 특히 io_uring 시스템에서의 초기화되지 않은 메모리 취약점입니다.
이 크래시는 Syzkaller로 발견되었습니다. 크래시 분석은 Joseph Ravichandran과 Michael Wang이 수행했습니다. 익스플로잇은 Joseph Ravichandran이 작성했습니다.
이 버그는 6.858 at MIT, Spring 2022 최종 프로젝트의 일환으로 발견 및 보고되었습니다.
3e08773c3841 ("block: switch polling to be bio based") 이후, 32452a3eb8b6 ("io_uring: fix uninitialized field in rw io_kiocb") 이전의 커널은 이 취약점에 영향을 받을 수 있습니다.
/dev/sr0는 권한이 없는 사용자가 읽을 수 있어야 합니다.Busybox 설치(KVM 없음)에서 128MB 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'
etc/passwd에는 비루트 사용자(attacker)와 루트 사용자(root)가 있습니다:
attacker:x:1000:1000:Linux User,,,:/home/attacker:/bin/sh
root:x:0:0:root:/tmp:/bin/sh
커널은 x86_64용 make defconfig로 컴파일되었으며, 일부 추가 추적/디버깅 기능이 활성화되었습니다.
make로 컴파일./spray./exploit