> In cases which map chip memory from vmalloc()'d ranges, the hfi1 infiniband > drivers currently installs a fault handler, and then smuggles the kernel > virtual address of this range in vma->vm_pgoff. > > This is exposing KASLR-sensitive internal kernel state in the VMA, and is > entirely unnecessary. > > Instead, use remap_vmalloc_range() to remap the VMA to the span, and > eliminate the fault handler altogether. > > remap_vmalloc_range() checks that the VMA does not extend beyond the > vmalloc area, and the driver already requires the VMA to exactly match the > span of the memory being mapped, so this has no impact. > > The memory is all preallocated so not having a fault handler has no impact > [ ... ] > There is a change in behaviour in that pages mapped using > remap_vmalloc_range() will now have normal GUP-able pages, however this > should have no impact as there is no reason not to allow this. > > Signed-off-by: Lorenzo Stoakes (ARM) <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.dev/#/patchset/20260917-b4-mmap-prepare-vma-flag-sanify-v3-0-4583d8a23...@kernel.org?part=11
