Skip to content

Commit

Permalink
iommu: Fix a check in iommu_check_bind_data()
Browse files Browse the repository at this point in the history
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: d905738 ("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>
  • Loading branch information
Dan Carpenter authored and joergroedel committed Nov 3, 2020
1 parent 71cd8e2 commit 4dd6ce4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/iommu.c
Expand Up @@ -2071,7 +2071,7 @@ EXPORT_SYMBOL_GPL(iommu_uapi_cache_invalidate);

static int iommu_check_bind_data(struct iommu_gpasid_bind_data *data)
{
u32 mask;
u64 mask;
int i;

if (data->version != IOMMU_GPASID_BIND_VERSION_1)
Expand Down

0 comments on commit 4dd6ce4

Please sign in to comment.