DragonFlyBSD Kernel Audit
DF-1139 / run.log
← back to finding ↓ download raw
### build
/tmp/DF-1139.c:29:12: warning: 'buggy_read' defined but not used [-Wunused-function]
 static int buggy_read(struct cac_leakage_table *t, uint32_t v_index)
            ^~~~~~~~~~
BUILD_RC=0
### run
=== DF-1139 harness: crafted VBIOS with cac_leakage_table.ucNumEntries==0 ===

    r600_dpm.c:1039-1043 calls kzalloc(0 * sizeof(entry)) = kzalloc(0)
    -> returns ZERO_SIZE_PTR == 0x10 (NON-NULL)
    -> count = 0 (loaded directly from BIOS u8)

[A] Buggy guard (si_dpm.c:4158 `if (entries)`):
    entries=0x10 is non-NULL, so body executes with count==u0
    reads entries[count-1] = entries[0xffffffff]
    effective address = 0x10 + 0xffffffff * 8 = 0x0000000800000008
    >>> In kernel: page-fault at ~32 GB offset -> panic <<<

[B] Fixed guard (fix.diff: `if (entries && count > 0)`):
    rc=-1  (rejected, no OOB read)
RUN_RC=0