diff options
author | Qasim Ijaz <qasdev00@gmail.com> | 2025-01-14 01:38:20 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2025-01-14 20:53:18 +0300 |
commit | e24c1551059268b37f6f40639883eafb281b8b9c (patch) | |
tree | 328de560160c7e73568feb69bcae28128711f73b /tools/perf/scripts/python/parallel-perf.py | |
parent | d9df72c6acd683adf6dd23c061f3a414ec00b1f8 (diff) | |
download | linux-e24c1551059268b37f6f40639883eafb281b8b9c.tar.xz |
iommufd/iova_bitmap: Fix shift-out-of-bounds in iova_bitmap_offset_to_index()
Resolve a UBSAN shift-out-of-bounds issue in iova_bitmap_offset_to_index()
where shifting the constant "1" (of type int) by bitmap->mapped.pgshift
(an unsigned long value) could result in undefined behavior.
The constant "1" defaults to a 32-bit "int", and when "pgshift" exceeds
31 (e.g., pgshift = 63) the shift operation overflows, as the result
cannot be represented in a 32-bit type.
To resolve this, the constant is updated to "1UL", promoting it to an
unsigned long type to match the operand's type.
Fixes: 58ccf0190d19 ("vfio: Add an IOVA bitmap support")
Link: https://patch.msgid.link/r/20250113223820.10713-1-qasdev00@gmail.com
Reported-by: syzbot <syzbot+85992ace37d5b7b51635@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=85992ace37d5b7b51635
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions