[Intel-gfx] [PATCH] drm/i915/gem: Store mmap_offsets in an rbtree rather than a plain list

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 17 22:06:34 UTC 2020


Quoting Chris Wilson (2020-01-17 22:00:38)
> Currently we create a new mmap_offset for every call to
> mmap_offset_ioctl. This exposes ourselves to an abusive client that may
> simply create new mmap_offsets ad infinitum, which will exhaust physical
> memory and the virtual address space. In addition to the exhaustion, a
> very long linear list of mmap_offsets causes other clients using the
> object to incur long list walks -- these long lists can also be
> generated by simply having many clients generate their own mmap_offset.
> 
> Switching to an rbtree store for obj->mmo.offsets allows us to use a
> binary search for duplicated mmap_offsets (preventing the exhaustion
> from a trivial malicious client), and also quickly search for matching
> mmap_offsets on object close.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>

Hmm, mmo->file only serves for revoking, duplicating drm_vma_node_revoke
itself. I think we can do better yet.
-Chris


More information about the Intel-gfx mailing list