mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
2e22aac3ea
iommufd_test_dirty()/IOMMU_TEST_OP_DIRTY sets the dirty bits in the mock
domain implementation that the userspace side validates against what it
obtains via the UAPI.
However in introducing iommufd_test_dirty() it forgot to validate page_size
being 0 leading to two possible divide-by-zero problems: one at the
beginning when calculating @max and while calculating the IOVA in the
XArray PFN tracking list.
While at it, validate the length to require non-zero value as well, as we
can't be allocating a 0-sized bitmap.
Link: https://lore.kernel.org/r/20231030113446.7056-1-joao.m.martins@oracle.com
Reported-by: syzbot+25dc7383c30ecdc83c38@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-iommu/00000000000005f6aa0608b9220f@google.com/
Fixes:
|
||
---|---|---|
.. | ||
device.c | ||
double_span.h | ||
hw_pagetable.c | ||
io_pagetable.c | ||
io_pagetable.h | ||
ioas.c | ||
iommufd_private.h | ||
iommufd_test.h | ||
iova_bitmap.c | ||
Kconfig | ||
main.c | ||
Makefile | ||
pages.c | ||
selftest.c | ||
vfio_compat.c |