]> git.baikalelectronics.ru Git - kernel.git/commit
iommu: Fix a check in iommu_check_bind_data()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 3 Nov 2020 10:16:23 +0000 (13:16 +0300)
committerJoerg Roedel <jroedel@suse.de>
Tue, 3 Nov 2020 13:55:51 +0000 (14:55 +0100)
commita52d72e17791fb558cc09c877e4ff1a7a66437c1
treef436e88e80c3a0ff7a07d6abb4a98f5b96ef41bd
parentd6dfbf4548161a2da55ebadc0d174f18ab89a20f
iommu: Fix a check in iommu_check_bind_data()

The "data->flags" variable is a u64 so if one of the high 32 bits is
set the original code will allow it, but it should be rejected.  The
fix is to declare "mask" as a u64 instead of a u32.

Fixes: 68457ee67e6a ("iommu/uapi: Handle data and argsz filled by users")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201103101623.GA1127762@mwanda
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c