You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When allocating IOVA the candidate range gets aligned to the target
alignment. If the range is close to ULONG_MAX then the ALIGN() can
wrap resulting in a corrupted iova.
Open code the ALIGN() using get_add_overflow() to prevent this.
This simplifies the checks as we don't need to check for length earlier
either.
Consolidate the two copies of this code under a single helper.
This bug would allow userspace to create a mapping that overlaps with some
other mapping or a reserved range.
Cc: [email protected]
Fixes: 51fe614 ("iommufd: Data structure to provide IOVA to PFN mapping")
Reported-by: [email protected]
Closes: https://lore.kernel.org/r/[email protected]
Reviewed-by: Yi Liu <[email protected]>
Reviewed-by: Nicolin Chen <[email protected]>
Link: https://patch.msgid.link/all/[email protected]/
Signed-off-by: Jason Gunthorpe <[email protected]>
0 commit comments