]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iommu_gas: avoid overflow in bounds check
authorDoug Moore <dougm@FreeBSD.org>
Thu, 22 Dec 2022 20:31:57 +0000 (14:31 -0600)
committerDoug Moore <dougm@FreeBSD.org>
Sun, 25 Dec 2022 07:01:16 +0000 (01:01 -0600)
commit8765df60dc26bad9d363a57a88ecfdd3fdbaf603
treee5a582ea18fcf0c111120d4f1d63c03ec3f90bb4
parentc5084b3fbcd393ee7c92c81db40652dad88c2121
iommu_gas: avoid overflow in bounds check

Change the range test in iommu_gas_match_one from '< ubound' to '<=
ubound', and pass a smaller-by-one ubound parameter to it, to avoid
overflow in ubound calculation.

Reported by: andrew
Reviewed by: andrew (previous version)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D37764

(cherry picked from commit 5b9b55fbc43261fc1467caaf7f2b70b8f752e479)
sys/dev/iommu/iommu_gas.c