[PATCH 2/2] drm/i915/gem: Fix Virtual Memory mapping boundaries calculation

Jann Horn jannh at google.com
Fri Aug 2 08:43:15 UTC 2024


On Fri, Aug 2, 2024 at 10:39 AM Andi Shyti <andi.shyti at linux.intel.com> wrote:
> Calculating the size of the mapped area as the lesser value
> between the requested size and the actual size does not consider
> the partial mapping offset. This can cause page fault access.
>
> Fix the calculation of the starting and ending addresses, the
> total size is now deduced from the difference between the end and
> start addresses.
>
> Additionally, the calculations have been rewritten in a clearer
> and more understandable form.
>
> Fixes: c58305af1835 ("drm/i915: Use remap_io_mapping() to prefault all PTE in a single pass")
> Reported-by: Jann Horn <jannh at google.com>
> Co-developed-by: Chris Wilson <chris.p.wilson at linux.intel.com>
> Signed-off-by: Chris Wilson <chris.p.wilson at linux.intel.com>
> Signed-off-by: Andi Shyti <andi.shyti at linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Matthew Auld <matthew.auld at intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: <stable at vger.kernel.org> # v4.9+

Reviewed-by: Jann Horn <jannh at google.com>


More information about the dri-devel mailing list