โฌข DragonFlyBSD Kernel Audit
DF-4946 / run.log
โ† back to finding โ†“ download raw
== DCN10 REG() domain: REG(DC_GPIO_DDC1_A)=0x5d91 REG(DC_GPIO_DDCVGA_A)=0x5da9 REG(DC_GPIO_I2CPAD_A)=0x5dc1 ==
(VBIOS gpio_pin_lut data_a_reg_index stores these full offsets โ€” bios_parser2.c:537-539)

== T1: DDC/VGA/I2CPAD offsets return success WITHOUT writing *id (DF-4946) ==
(dal_gpio_service_create_irq gpio_service.c:148-149 declares 'enum gpio_id id;' uninitialized)
offset_to_id(REG(DDC1  ),0x100) = true  en=0 (id==0x7b7b7b7b UNTOUCHED)
  -> BUG(DF-4946): success, *id never written
offset_to_id(REG(DDC2  ),0x100) = true  en=1 (id==0x7b7b7b7b UNTOUCHED)
  -> BUG(DF-4946): success, *id never written
offset_to_id(REG(DDC3  ),0x100) = true  en=2 (id==0x7b7b7b7b UNTOUCHED)
  -> BUG(DF-4946): success, *id never written
offset_to_id(REG(DDC4  ),0x100) = true  en=3 (id==0x7b7b7b7b UNTOUCHED)
  -> BUG(DF-4946): success, *id never written
offset_to_id(REG(DDC5  ),0x100) = true  en=4 (id==0x7b7b7b7b UNTOUCHED)
  -> BUG(DF-4946): success, *id never written
offset_to_id(REG(DDC6  ),0x100) = true  en=5 (id==0x7b7b7b7b UNTOUCHED)
  -> BUG(DF-4946): success, *id never written
offset_to_id(REG(DDCVGA),0x100) = true  en=6 (id==0x7b7b7b7b UNTOUCHED)
  -> BUG(DF-4946): success, *id never written; garbage id==GPIO_ID_HPD(3) => dal_gpio_create(HPD, en=6) indexes hpd_regs[6] OOB (hpd_regs has 6 entries)
offset_to_id(REG(I2CPAD),0x100) = true  en=7 (id==0x7b7b7b7b UNTOUCHED)
  -> BUG(DF-4946): success, *id never written; garbage id==GPIO_ID_HPD(3) => dal_gpio_create(HPD, en=7) indexes hpd_regs[7] OOB (hpd_regs has 6 entries)

== T2 (negative): no GPIOPAD cross-domain case; Not-implemented rejects ==
    [ASSERT_CRITICAL hit]
offset_to_id(0x183,1<<20)        = false (no GPIOPAD mapping -> rejected: OK; the dce80-style deterministic producer does not exist on DCN10)
offset_to_id(REG(DC_GPIO_DEBUG)) = false (Not-implemented path: OK)

== T3: id_to_offset DDC mask-vs-index โ€” I2C_PAD data mask is WRONG (DF-4947) ==
id_to_offset(DDC_DATA, I2C_PAD)   = true offset=0x5dc1 mask=0x100 โ€” DC_GPIO_I2CPAD_A SDA field is bit1 (0x2): WRONG BIT
id_to_offset(DDC_CLOCK, I2C_PAD)  = true offset=0x5dc1 mask=0x1 โ€” SCL field is bit0: coincidentally correct
id_to_offset(DDC_DATA, DDC_VGA)   = true offset=0x5da9 mask=0x100 โ€” DDCVGADATA_A_MASK is also 0x100: correct by layout

== T4 (negative): HPD branch well-formed ==
offset_to_id(REG(HPD),HPD1 mask) = true  id=3 en=0
offset_to_id(REG(HPD),HPD2 mask) = true  id=3 en=1
offset_to_id(REG(HPD),HPD3 mask) = true  id=3 en=2
offset_to_id(REG(HPD),HPD4 mask) = true  id=3 en=3
offset_to_id(REG(HPD),HPD5 mask) = true  id=3 en=4
offset_to_id(REG(HPD),HPD6 mask) = true  id=3 en=5

9 contract-violation reproductions
EXIT=0
== id_to_offset DDC mask-vs-register-field audit (DF-4947) ==
DDC1-6/VGA DATA/CLK fields are laid out identically to DDC6
(bit8/bit0), so the hardwired DDC6 masks are correct there.
DC_GPIO_I2CPAD_A is NOT: SDA=bit1(0x2), SCL=bit0(0x1).

id_to_offset(DDC_DATA, DDC1)       = true  offset=0x5d91 mask=0x100  real field mask=0x100  OK
id_to_offset(DDC_DATA, DDC_VGA)    = true  offset=0x5da9 mask=0x100  real field mask=0x100  OK
id_to_offset(DDC_CLOCK, I2C_PAD)   = true  offset=0x5dc1 mask=0x1    real field mask=0x1    OK
id_to_offset(DDC_DATA, I2C_PAD)    = true  offset=0x5dc1 mask=0x100  real field mask=0x2    WRONG BIT (DF-4947)

1 wrong-mask lines (DDC_DATA+I2C_PAD is the DF-4947 defect)
MASK_EXIT=0
== FIXED T1: *id is now written on every DDC-family success ==
offset_to_id(REG(DDC1  ),0x100) = true  en=0 id=0 (WRITTEN)
offset_to_id(REG(DDC2  ),0x100) = true  en=1 id=0 (WRITTEN)
offset_to_id(REG(DDC3  ),0x100) = true  en=2 id=0 (WRITTEN)
offset_to_id(REG(DDC4  ),0x100) = true  en=3 id=0 (WRITTEN)
offset_to_id(REG(DDC5  ),0x100) = true  en=4 id=0 (WRITTEN)
offset_to_id(REG(DDC6  ),0x100) = true  en=5 id=0 (WRITTEN)
offset_to_id(REG(DDCVGA),0x100) = true  en=6 id=0 (WRITTEN)
offset_to_id(REG(I2CPAD),0x100) = true  en=7 id=0 (WRITTEN)
  -> with id==GPIO_ID_DDC_DATA, dal_gpio_create_irq (gpio_service.c:373-381)
     takes the default branch and returns NULL: define_hpd_registers
     (hw_factory_dcn10.c:149-157) can never be reached with en=6/7 -> no OOB

== FIXED T3: I2C_PAD data mask is now the real SDA field ==
id_to_offset(DDC_DATA, I2C_PAD) = true offset=0x5dc1 mask=0x2 (SDA_A_MASK=0x2: CORRECT)

0 residual violations (0 expected)
FIXEXIT=0