]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-kernel-next.git/commit
iommu/arm-smmu: Limit 2-level strtab allocation for small SID sizes
authorWill Deacon <will.deacon@arm.com>
Thu, 16 Jul 2015 16:50:12 +0000 (17:50 +0100)
committerAlex Shi <alex.shi@linaro.org>
Mon, 18 Apr 2016 06:46:04 +0000 (14:46 +0800)
commitb608ba0e600ef8c701654e9947882442cec12e02
treea4eb6bc6b146817f5ec822214dd81695f919b186
parentbe6db280eba56b6f5d083c58d54161a66d059abe
iommu/arm-smmu: Limit 2-level strtab allocation for small SID sizes

If the StreamIDs in a system can all be resolved by a single level-2
stream table (i.e. SIDSIZE < SPLIT), then we currently get our maths
wrong and allocate the largest strtab we support, thanks to unsigned
overflow in our calculation.

This patch fixes the issue by checking the SIDSIZE explicitly when
calculating the size of our first-level stream table.

Reported-by: Matt Evans <matt.evans@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 28c8b4045b18b013e05656b493ce9a57cbf1f09a)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
drivers/iommu/arm-smmu-v3.c