# DF-3827 — e1000 HAL: unchecked PHY register read feeds stale data into a write-back (`e1000_set_d0_lplu_state_82575`)

## What

`sys/dev/netif/ig_hal/e1000_82575.c:833-837`, inside the `active == TRUE`
branch of `e1000_set_d0_lplu_state_82575()`:

```c
833		ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
834					    &data);
835		data &= ~IGP01E1000_PSCFR_SMART_SPEED;      /* ret_val NOT checked */
836		ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
837					     data);              /* overwrites it   */
```

The return value of the read at 833 is clobbered by the write at 836 without
ever being tested. If the PHY read fails (MDIO timeout, PHY in reset,
contention — exactly the error family of DF-3643), `data` still holds the
`IGP02E1000_PHY_POWER_MGMT` value read at 821, and that stale 16-bit value —
masked with a SmartSpeed bit belonging to a different register — is written
into `IGP01E1000_PHY_PORT_CONFIG`.

Both sibling branches of the same function check their reads correctly
(851-855 and 864-868: `if (ret_val) goto out;`), which confirms the 833
instance is an omission, not a design choice.

## Impact

PHY misconfiguration only (register-level corruption of the port-config
register on IGP03E/IGP04E PHYs during LPLU power-state transitions); no
kernel memory-safety impact. Requires the specific PHYs
(`phy->id == IGP03E1000_E_PHY_ID || IGP04E1000_E_PHY_ID`, dispatched at
286-295) **and** a failing MDIO read at that instant. Severity Low; this is
the 82575-family twin of the ich8lan unchecked-PHY-read finding (DF-3643
family) named in the audit checklist (item b).

## Reproduce

Not executable on the audit guest: the function is a `phy->ops` callback of
the igb(4)/HAL stack and requires an attached Intel 82575/i350-class device
with an IGP03/IGP04 PHY. The guest has no such device (`pciconf -l` in
`env.txt` shows virtio-only). Verdict: `not_reproduced`, defect certain at
source level.

## Fix

`fix.diff` adds the missing `if (ret_val) goto out;` between read and
write-back, mirroring the two sibling branches.
