#!/bin/sh
# DF-1165 runtime test — NOT EXECUTABLE ON THIS GUEST (no GPU / no display).
# The bug requires a DRM-attached GPU whose connector reads an EDID
# extension containing a crafted DisplayID DATA_BLOCK_TILED_DISPLAY block
# with num_bytes < 21. Realistic vector: malicious monitor / DP-HDMI adapter
# / VM virtual display. The QEMU audit guest has no GPU.
set -e
echo "DF-1165: drm_parse_tiled_block heap OOB read"
echo "----------------------------------------------"
echo "PREREQ: DRM-attached GPU + malicious monitor/adapter with crafted EDID"
echo "        containing DATA_BLOCK_TILED_DISPLAY (0x12) num_bytes < 21."
echo
pciconf -lv 2>/dev/null | grep -i 'display\|vga\|gpu' || true
if ! pciconf -lv 2>/dev/null | grep -q -i 'display\|vga'; then
    echo "no GPU/display device present — cannot trigger"
    exit 0
fi
echo "On a vulnerable kernel with such a connector, hotplugging the malicious"
echo "EDID would cause drm_parse_tiled_block to read past the EDID extension"
echo "into adjacent kernel heap (up to 16 bytes)."
