diff options
author | kib <kib@FreeBSD.org> | 2015-03-24 08:21:36 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-03-24 08:21:36 +0000 |
commit | 81e69ec09eee7a6ec6f389a671af5d69b6799355 (patch) | |
tree | 6b07f92a321c0178d06a87e67cbabaf9a1a5fc27 /sys | |
parent | 3fef6ad686297371c81bb2bdefe0993b030c3afd (diff) | |
download | FreeBSD-src-81e69ec09eee7a6ec6f389a671af5d69b6799355.zip FreeBSD-src-81e69ec09eee7a6ec6f389a671af5d69b6799355.tar.gz |
MFC r280196:
Recheck that boundary is not crossed after the move to satisfy boundary
restriction.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/x86/iommu/intel_gas.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/x86/iommu/intel_gas.c b/sys/x86/iommu/intel_gas.c index 5ccf34b..2049744 100644 --- a/sys/x86/iommu/intel_gas.c +++ b/sys/x86/iommu/intel_gas.c @@ -327,13 +327,15 @@ dmar_gas_match_one(struct dmar_gas_match_args *a, struct dmar_map_entry *prev, start = roundup2(bs, a->common->alignment); /* DMAR_PAGE_SIZE to create gap after new entry. */ if (start + a->size + DMAR_PAGE_SIZE <= prev->end + prev->free_after && - start + a->size <= end) { + start + a->size <= end && dmar_test_boundary(start, a->size, + a->common->boundary)) { a->entry->start = start; return (true); } /* - * Not enough space to align at boundary, but allowed to split. + * Not enough space to align at the requested boundary, or + * boundary is smaller than the size, but allowed to split. * We already checked that start + size does not overlap end. * * XXXKIB. It is possible that bs is exactly at the start of |