DragonFlyBSD Kernel Audit
DF-1044 / verify.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-1044 — static source-level verification of both defects.
# Prints the exact cited lines proving each defect.
set -e

F=${1:-/home/maxx/dfbsd/dfbsd/sys/platform/vkernel64/platform/busdma_machdep.c}

echo "=== DF-1044 source verification ==="
echo "File: $F"
echo
echo "--- DEFECT (a): panic stub in add_map_callback (#else branch of #ifdef notyet) ---"
echo "[line 1202-1217]"
sed -n '1202,1217p' "$F"
echo
echo "--- DEFECT (c): transposition at return_bounce_pages line 1120 ---"
echo "[line 1094-1121, focus line 1120]"
sed -n '1094,1121p' "$F"
echo
echo "--- COMPARE: free_bounce_page does it CORRECTLY (local map = get_map_waiting) ---"
echo "[line 1156-1181, focus lines 1175-1180]"
sed -n '1156,1181p' "$F"
echo
echo "--- DEFECT (b): busdma_swi is #ifdef notyet and is NEVER called anywhere in vkernel64 ---"
echo "[line 1219-1234]"
sed -n '1219,1234p' "$F"
echo
echo "[grep: busdma_swi callers in vkernel64 (expect only the definition)]"
grep -rn 'busdma_swi\s*(' /home/maxx/dfbsd/dfbsd/sys/platform/vkernel64/ || echo "(no callers)"
echo
echo "[compare pc64 sibling: pc64 wires busdma_swi from swi_vm]"
grep -n 'busdma_swi' /home/maxx/dfbsd/dfbsd/sys/platform/pc64/x86_64/vm_machdep.c
echo
echo "=== verification complete: both defects present in source ==="