alc_rxeof() used the 12-bit RD_IDX field from the Rx return descriptor
to index the 256-entry Rx descriptor ring without validation; the first
access could fall outside the ring. Drop the frame if the index is
outside the ring.
Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| sys/dev/alc/if_alc.c | ||
|---|---|---|
| 3640 | We should also increment IFCOUNTER_IERRORS here. | |
Comment Actions
Good catch. Added if_inc_counter(ifp, IFCOUNTER_IERRORS, 1) in the reject branch, matching the idiom used for malformed Rx descriptors in sge_rxeof() (sys/dev/sge/if_sge.c). ifp was already in scope there.