[PATCH 0/2] ACPI/IORT: handle potential overflows

2018-12-18 Thread Andrew Jones
I saw a couple places where overflows could potentially occur. I've only compile tested these changes. Thanks, drew Andrew Jones (2): ACPI/IORT: Handle potential overflow in iort_dma_setup iommu/dma: Handle potential overflow in iommu_dma_init_domain drivers/acpi/arm64/iort.c

[PATCH 1/2] ACPI/IORT: Handle potential overflow in iort_dma_setup

2018-12-18 Thread Andrew Jones
The sum of dmaaddr and size may overflow, particularly considering there are cases where size will be U64_MAX. Signed-off-by: Andrew Jones --- drivers/acpi/arm64/iort.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64

[PATCH 2/2] iommu/dma: Handle potential overflow in iommu_dma_init_domain

2018-12-18 Thread Andrew Jones
if we shouldn't at least warn when base is not aligned? Signed-off-by: Andrew Jones --- drivers/iommu/dma-iommu.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index d1b04753b204..a0b01398b15c 100644 ---

Re: [PATCH 1/2] ACPI/IORT: Handle potential overflow in iort_dma_setup

2018-12-19 Thread Andrew Jones
On Wed, Dec 19, 2018 at 12:21:35PM +, Robin Murphy wrote: > On 18/12/2018 18:48, Andrew Jones wrote: > > The sum of dmaaddr and size may overflow, particularly considering > > there are cases where size will be U64_MAX. > > Only if the firmware is broken in the first pl