Skip to content
Commit 59c36286 authored by David Woodhouse's avatar David Woodhouse
Browse files

intel-iommu: Fix integer overflow in dma_pte_{clear_range,free_pagetable}()



If end_pfn is equal to (unsigned long)-1, then the loop will never end.

Seen on 32-bit kernel, but could have happened on 64-bit too once we get
hardware that supports 64-bit guest addresses.

Change both functions to a 'do {} while' loop with the test at the end,
and check for the PFN having wrapper round to zero.

Reported-by: default avatarBenjamin LaHaise <ben.lahaise@neterion.com>
Tested-by: default avatarBenjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 2ebe3151
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment