dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] drm/qxl: fix multiple missing bounds checks in execbuffer relocations
@ 2026-09-13 22:29 Aldo Ariel Panzardo
  2026-09-13 22:29 ` [PATCH v2 1/4] drm/qxl: validate relocation dst_offset against destination BO Aldo Ariel Panzardo
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Aldo Ariel Panzardo @ 2026-09-13 22:29 UTC (permalink / raw)
  To: airlied, kraxel; +Cc: dri-devel, stable, Aldo Ariel Panzardo

The qxl execbuffer ioctl processes user-supplied relocation entries
without adequate validation, enabling several memory-safety violations
reachable from any DRM_AUTH render client.

Patch 1 is a v2 of a previously submitted single patch.  The v1 had two
gaps identified by sashiko-bot review: the upper bound for dst_handle==0
relocations did not account for the write width, and the general BO
bounds check could overflow on ILP32.  Both are fixed in this revision.

Patches 2-4 fix pre-existing issues in the same code path that were
surfaced during the v1 review:

  - Patch 2: The release sub-allocator ignores the requested size and
    always uses 256-byte slots, but the ioctl allows commands up to
    ~4088 bytes, overflowing into adjacent slots.

  - Patch 3: Relocations with page-unaligned offsets can write past a
    single-page kmap mapping.

  - Patch 4: src_offset is silently truncated from __u64 to int and
    never validated, generating out-of-bounds physical addresses.

Aldo Ariel Panzardo (4):
  drm/qxl: validate relocation dst_offset against destination BO
  drm/qxl: reject command sizes that exceed the release slot
  drm/qxl: reject relocations whose writes cross a page boundary
  drm/qxl: validate relocation src_offset and fix type truncation

 drivers/gpu/drm/qxl/qxl_ioctl.c   | 28 +++++++++++++++++++++++++++-
 drivers/gpu/drm/qxl/qxl_release.c |  3 +++
 2 files changed, 30 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-13 22:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-13 22:29 [PATCH v2 0/4] drm/qxl: fix multiple missing bounds checks in execbuffer relocations Aldo Ariel Panzardo
2026-09-13 22:29 ` [PATCH v2 1/4] drm/qxl: validate relocation dst_offset against destination BO Aldo Ariel Panzardo
2026-09-13 22:44   ` sashiko-bot
2026-09-13 22:29 ` [PATCH v2 2/4] drm/qxl: reject command sizes that exceed the release slot Aldo Ariel Panzardo
2026-09-13 22:45   ` sashiko-bot
2026-09-13 22:29 ` [PATCH v2 3/4] drm/qxl: reject relocations whose writes cross a page boundary Aldo Ariel Panzardo
2026-09-13 22:45   ` sashiko-bot
2026-09-13 22:30 ` [PATCH v2 4/4] drm/qxl: validate relocation src_offset and fix type truncation Aldo Ariel Panzardo
2026-09-13 22:46   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox