#!/bin/sh
# DF-2626 PoC run — run ON THE GUEST as an UNPRIVILEGED user, from a dir on
# the hammer2 root fs (NOT /tmp — tmpfs returns EFAULT correctly).
#
# Vulnerable (stock) kernel: ./poc never returns from read(); the process
# spins at 100% CPU in kernel mode and survives kill -9.  Six instances on
# six DIFFERENT hammer2 files starve every CPU (full system wedge).
#
# Fixed kernel: "read returned -1 errno=14 (Bad address) — bug NOT
# reproduced", exit 0, in 0.00 s.
echo "kernel: $(uname -v)"
timeout 5 ./poc /etc/rc; echo "poc exit=$? (124 => STILL SPINNING after 5s => vulnerable)"
timeout 5 ./readlink_poc; echo "readlink_poc exit=$? (124 => vulnerable)"
