It was observed that allocating large objects via i915 driver
(igt-gpu-tools/tests/gem_exec_big/single) the folios and their
pages were not handled properly leading to buffer corruptions
during relocations.
Furthermore, using iommu driver in this context would leave
residual mappings in memory that could not be released, hogging
available RAM even after the process ended.

v6:
 * split max_segment validation into its own patch;
 * added Fixes: tags and Cc: stable to the fixup patches;
 * repaired bits pointed out by checkpatch;
 * ran local regression checks and automated review process via
   Claude Opus and added Assisted-by: tags.

Krzysztof Karas (7):
  drm/i915/shmem: Validate max_segment
  drm/i915/gem: Count mapped pages in a folio
  drm/i915/gem: Free sg table on failure to acquire second folio
  iommu/dma: Catch scatterlist length overflows
  drm/i915/gem: Pull out size validation into a separate function
  drm/i915/gem: Read and shrink memory in a separate function
  drm/i915/gem: Remove iterator and use while loop

 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 172 ++++++++++++++--------
 drivers/iommu/dma-iommu.c                 |  17 ++-
 2 files changed, 124 insertions(+), 65 deletions(-)

-- 
2.34.1

Reply via email to