Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc30e963 authored by Liam Mark's avatar Liam Mark
Browse files

iommu: iommu-debug: Fix dma map bounds check



Fix so that size of map is taken into account.

Change-Id: Id4262525e746b36ef6353c03367ba0c3b187a54c
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
parent f0a4ec7d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1862,7 +1862,7 @@ static ssize_t iommu_debug_dma_map_write(struct file *file,
	if (kstrtouint(comma2 + 1, 0, &attr))
		goto invalid_format;

	if (v_addr < test_virt_addr || v_addr > (test_virt_addr + SZ_1M - 1))
	if (v_addr < test_virt_addr || v_addr + size > test_virt_addr + SZ_1M)
		goto invalid_addr;

	if (attr == 0)