Page MenuHomeFreeBSD

amd_iommu: Bound IVHD device-entry parsing
Needs ReviewPublic

Authored by kbowling on Sat, Aug 8, 7:27 AM.
Tags
None
Referenced Files
F166938696: D58724.id183677.diff
Mon, Aug 17, 10:04 PM
F166936757: D58724.id183668.diff
Mon, Aug 17, 9:30 PM
F166867666: D58724.id.diff
Mon, Aug 17, 7:58 AM
F166844934: D58724.id183686.diff
Mon, Aug 17, 1:07 AM
Unknown Object (File)
Sun, Aug 16, 4:00 PM
Unknown Object (File)
Sun, Aug 16, 6:23 AM
Unknown Object (File)
Fri, Aug 14, 9:07 PM
Unknown Object (File)
Thu, Aug 13, 3:24 AM
Subscribers

Details

Reviewers
kib
Summary
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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/x86/iommu/amd_drv.c
699

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
135

Why do you check this only for the requested type?