Validate the IVRS table and every subtable length before using either to form iterator bounds. Reject truncated typed IVHD blocks instead of passing them to a type-specific callback. Within each IVHD payload, correct the lower-bound comparison for extended range entries and validate fixed-size entries, paired range terminators, the fixed HID body, and the variable HID UID before dereferencing or advancing. Malformed firmware can no longer drive either iterator beyond its enclosing object. MFC after: 2 weeks
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| sys/x86/iommu/amd_drv.c | ||
|---|---|---|
| 708 | I do not like repeating the list of supported types of entries twice. Why cannot the check for the length embedded into the corresponding handler directly? | |
| sys/x86/iommu/amd_drv.c | ||
|---|---|---|
| 123 | Why do you check this only for the requested type? | |
| sys/x86/iommu/amd_drv.c | ||
|---|---|---|
| 100 | Either return (done); or move the initialization of done after this if() | |