drm/qxl: fix multiple missing bounds checks in execbuffer relocations
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 0 repliesNew
- v11 patch 0 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | drm/qxl: validate relocation dst_offset against destination BOdrivers/ | +16 | 0 replies | |
| 2/4 | drm/qxl: reject command sizes that exceed the release slotdrivers/ | +3 | 0 replies | |
| 3/4 | drm/qxl: reject relocations whose writes cross a page boundarydrivers/ | +6 | 0 replies | |
| 4/4 | drm/qxl: validate relocation src_offset and fix type truncationdrivers/ | +5 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/4] drm/qxl: fix multiple missing bounds checks in execbuffer relocations
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(-)
Signature · 1 line
2.43.0