⬢ DragonFlyBSD Kernel Audit
DF-4729 / verify.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-4729 — static proof chain (no Intel Gen9+ GPU exists on the audit guest).
# Every step prints the cited source lines. Exit 0 = chain confirmed.
set -e
R="${1:-.}"
cd "$R"
I=sys/dev/drm/i915

echo "== [1] intel_guc_log_create: only call site is inside #if 0 =="
rg -n "intel_guc_log_create" $I/intel_guc.c $I/intel_guc_log.c $I/intel_guc_log.h
sed -n '200,207p' $I/intel_guc.c

echo "== [2] log->vma is assigned nowhere else (expect NO output) =="
rg -n "log->vma\s*=|log\.vma\s*=" $I/ | grep -v "intel_guc_log.c" || echo "  (no other assignment — confirmed)"

echo "== [3] guc_ctl_log_params_flags dereferences guc->log.vma (:296) =="
sed -n '294,297p' $I/intel_guc.c

echo "== [4] called unconditionally from intel_guc_init_params (:359) =="
sed -n '356,361p' $I/intel_guc.c

echo "== [5] <- intel_uc_init_hw (intel_uc.c:377), before any fw-status check =="
sed -n '362,379p' $I/intel_uc.c

echo "== [6] <- i915_gem.c:5746 (driver load / hw init) =="
sed -n '5744,5748p' $I/i915_gem.c

echo "== [7] i915_ggtt_offset derefs vma in BOTH debug and release =="
sed -n '202,209p' $I/i915_vma.h
echo "-- GEM_BUG_ON compiled to no-op when !CONFIG_DRM_I915_DEBUG_GEM:"
sed -n '36,61p' $I/i915_gem.h | grep -A2 "#else" | head -4

echo "== [8] gate: enable_guc default 0 on this port =="
rg -n "param\(int, enable_guc" $I/i915_params.h
rg -n "param_named_unsafe\(enable_guc" -A3 $I/i915_params.c | head -5
echo "== USES_GUC -> intel_uc_is_using_guc =="
sed -n '44,54p' $I/intel_uc.h

echo
echo "CHAIN CONFIRMED: enable_guc!=0 on Gen9+ => intel_uc_init_hw"
echo "=> intel_guc_init_params => guc_ctl_log_params_flags"
echo "=> intel_guc_ggtt_offset(guc, NULL) => i915_ggtt_offset(NULL) => panic."