diff options
| author | Jason Gunthorpe <[email protected]> | 2025-07-17 14:46:55 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2025-07-17 14:46:55 +0000 |
| commit | b42497e3c0e74db061eafad41c0cd7243c46436b (patch) | |
| tree | b01a120f6428a55140d6debb8055d6a5b9f413bf /tools/perf/scripts/python/failed-syscalls-by-pid.py | |
| parent | iommu/tegra241-cmdqv: import IOMMUFD module namespace (diff) | |
| download | kernel-b42497e3c0e74db061eafad41c0cd7243c46436b.tar.gz kernel-b42497e3c0e74db061eafad41c0cd7243c46436b.zip | |
iommufd: Prevent ALIGN() overflow
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: 51fe6141f0f6 ("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]>
Diffstat (limited to 'tools/perf/scripts/python/failed-syscalls-by-pid.py')
0 files changed, 0 insertions, 0 deletions
