<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/vmwgfx, branch v7.2-rc6</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc6</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc6'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-07-27T15:29:24+00:00</updated>
<entry>
<title>drm/vmwgfx: validate external BO copy bounds for both stride paths</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=706c93c5813caabbb0d0a576c017d15aeec2c113'/>
<id>urn:sha1:706c93c5813caabbb0d0a576c017d15aeec2c113</id>
<content type='text'>
vmw_external_bo_copy() trusts caller-supplied offsets, strides, and
heights and operates on imported dma-buf vmaps:

  - The equal-stride memcpy() bound was clamped after subtracting the
    offsets from dst_size and src_size; an offset larger than the BO
    size wraps the unsigned subtraction to a huge value and the
    resulting memcpy() runs off the end of the vmap.  dst_stride *
    height is also a u32 multiplication that can overflow.
  - The non-equal-stride row-by-row path had no bound at all.  The
    loop touches bytes through offset + (height - 1) * stride +
    width_in_bytes, with only a WARN_ON(dst_stride &lt; width_in_bytes),
    and could likewise step past the end of either mapping.

The offsets and strides are derived from STDU/SOU plane state, so a
configured CRTC submitting a crafted atomic commit on an imported
framebuffer can reach this path.

Validate the exact row-copy endpoint against each BO's size up front
using check_mul_overflow() and check_add_overflow().  Use the bulk
memcpy() path only when width_in_bytes covers the whole stride;
otherwise copy one row at a time so partial-row updates near the bottom
of a framebuffer remain valid.  Also reject zero strides and stride &lt;
width_in_bytes, both of which the row-by-row path cannot represent
safely.

Fixes: 50f119925091 ("drm/vmwgfx: Fix prime with external buffers")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-13-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: use check_add_overflow for shader size+offset bound</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=54d56d5b42d2e4c72ba6e365e9774da90698aa22'/>
<id>urn:sha1:54d56d5b42d2e4c72ba6e365e9774da90698aa22</id>
<content type='text'>
vmw_shader_define() validates the user-supplied shader window against
its backing buffer with

	(u64)buffer-&gt;tbo.base.size &lt; (u64)size + (u64)offset

drm_vmw_shader_create_arg::offset is __u64 in the uapi; when it is
near U64_MAX the unsigned addition wraps and the resulting tiny value
passes the check.  The unbounded offset is then stored in
res-&gt;guest_memory_offset and forwarded to host SVGA shader-create
commands.

Use check_add_overflow() to detect the wrap and compare the resulting
endpoint against the buffer size.

Fixes: 668b206601c5 ("drm/vmwgfx: Stop using raw ttm_buffer_object's")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-12-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: skip hash_del_rcu when validation context has no hash table</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e5c3e484e0d84744a9bd9349469cd41dc8666a2f'/>
<id>urn:sha1:e5c3e484e0d84744a9bd9349469cd41dc8666a2f</id>
<content type='text'>
vmw_validation_add_resource() calls hash_add_rcu() only when
ctx-&gt;sw_context is non-NULL, but the doomed-resource error path calls
hash_del_rcu() unconditionally.  The validation contexts declared with
DECLARE_VAL_CONTEXT(_, NULL, 0) in vmwgfx_kms.c, vmwgfx_scrn.c,
vmwgfx_stdu.c and vmwgfx_execbuf.c consequently reach a delete for a
node that was never added to any hash chain.

That is harmless today, but only incidentally so.  hash_del_rcu() is
hlist_del_init_rcu(), which is guarded by hlist_unhashed(), and
vmw_validation_mem_alloc() hands out memory from __GFP_ZERO pages that
are never recycled within a context's lifetime, so
node-&gt;hash.head.pprev is always NULL and the delete does nothing.
Neither property is apparent at the call site, and the asymmetry with
the add side invites a real bug the first time either one changes.

Mirror the condition from the add side so the node is only unlinked
when it was actually linked.  No functional change.

Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-11-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: enforce cursor size limits for MOB cursors</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d5ed8749168ad13c0dbaa8300f68d854b6076966'/>
<id>urn:sha1:d5ed8749168ad13c0dbaa8300f68d854b6076966</id>
<content type='text'>
vmw_cursor_plane_atomic_check() bounds cursor width and height only
on the legacy update path; the SVGA_CAP2_CURSOR_MOB path -- the
default on modern hosts -- accepts any size.  When the requested size
exceeds SVGA_REG_CURSOR_MAX_DIMENSION or SVGA_REG_MOB_MAX_SIZE,
vmw_cursor_mob_get() returns -EINVAL and leaves vps-&gt;cursor.mob NULL.
Its return value is then discarded in vmw_cursor_plane_prepare_fb(),
so the subsequent vmw_cursor_update_mob() calls
vmw_bo_map_and_cache(NULL) and oopses inside
vmw_bo_map_and_cache_size() on the tbo.base.size load.

Reachable from any DRM master via DRM_IOCTL_MODE_CURSOR2 with a
sufficiently large width or height (e.g. cursor_max_dim + 1).

Reject oversized cursors in atomic_check for both MOB-backed cursor
update types.  The MOB byte-size limit only applies to the
SVGA_CAP2_CURSOR_MOB path (vmw_cursor_mob_size() returns 0 for
GB_ONLY); compute the required MOB size in 64-bit to avoid overflow
when very large dimensions are requested.

In prepare_fb only call vmw_cursor_mob_get()/_map() for
VMW_CURSOR_UPDATE_MOB -- the GB_ONLY path uses bo-&gt;map.virtual
directly and would otherwise be silently downgraded to NONE on hosts
without SVGA_CAP2_CURSOR_MOB (where vmw_cursor_mob_get() always
returns -EINVAL).  Degrade the update to NONE if vmw_cursor_mob_get()
or vmw_cursor_mob_map() fails so the update path does not run with a
NULL backing MOB.

Fixes: 965544150d1c ("drm/vmwgfx: Refactor cursor handling")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-10-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: avoid destroy_workqueue(NULL) on vkms init failure</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=05eaa887e7b4f40fba425f8a1d7a5a8a043092a6'/>
<id>urn:sha1:05eaa887e7b4f40fba425f8a1d7a5a8a043092a6</id>
<content type='text'>
Two paths through vmw_vkms_init() can leave vmw-&gt;crc_workq NULL while
still leaving the rest of the driver in a state that calls
vmw_vkms_cleanup() at module unload:

  1. vmw_host_get_guestinfo(GUESTINFO_VBLANK, ...) failing or
     returning an oversized buffer -- the common case on hosts
     without a VBLANK guestinfo entry -- early-returned before the
     workqueue allocation.
  2. alloc_ordered_workqueue() returning NULL on memory pressure.

vmw_vkms_cleanup() then calls destroy_workqueue(NULL), which
dereferences wq-&gt;name and panics.

Fix the first case by removing the early return: vmw-&gt;vkms_enabled
is already false on the rpci-failure path so no work will ever be
queued, and allocating the workqueue unconditionally keeps the
control flow simple.  Fix the second case by guarding the cleanup
with a NULL check, since alloc_ordered_workqueue() can still fail
under low memory.

Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-9-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: bound DMA command body size against suffix pointer</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f4f1db96bfd68b81053693ba53405b6f510ac16c'/>
<id>urn:sha1:f4f1db96bfd68b81053693ba53405b6f510ac16c</id>
<content type='text'>
vmw_cmd_dma() locates the DMA suffix at

	(unsigned long) &amp;cmd-&gt;body + header-&gt;size - sizeof(*suffix)

without checking that header-&gt;size is large enough to contain both
cmd-&gt;body and the suffix.  An undersized header makes the suffix
pointer underflow back into the previous command in the bounce
buffer.  The verifier later writes suffix-&gt;maximumOffset, clobbering
verified fields of an already-relocated earlier command -- a TOCTOU
on the device-visible command stream that lets one command rewrite
another's GMR id, surface id, or other authenticated fields.

Reject the command if the body is too small for the suffix to fit.

Fixes: 4e4ddd477743 ("drm/vmwgfx: Fix queries if no dma buffer thrashing is occuring.")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-8-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: validate DRAW_PRIMITIVES header size before division</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=85891d174707d8bddcec7a888fb4e1d17def34f3'/>
<id>urn:sha1:85891d174707d8bddcec7a888fb4e1d17def34f3</id>
<content type='text'>
vmw_cmd_draw() computes

	maxnum = (header-&gt;size - sizeof(cmd-&gt;body)) / sizeof(*decl);

where header-&gt;size is u32 and is taken straight from the user-supplied
command stream.  When header-&gt;size is less than sizeof(cmd-&gt;body) the
unsigned subtraction wraps to nearly 4 GiB, producing a huge maxnum.
Any user-controlled cmd-&gt;body.numVertexDecls then passes the bound and
the loop dereferences decl[i] far past the end of the kernel command
bounce buffer, producing an out-of-bounds read of kernel memory.

Reject undersized headers up front.

Fixes: 7a73ba7469cb ("drm/vmwgfx: Use TTM handles instead of SIDs as user-space surface handles.")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-7-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: drop dma_buf reference on foreign-fd prime import</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f739416dc555fa205a785e5135d73fa39b26f35d'/>
<id>urn:sha1:f739416dc555fa205a785e5135d73fa39b26f35d</id>
<content type='text'>
ttm_prime_fd_to_handle() returns -ENOSYS when the imported fd's
dma_buf-&gt;ops do not match the ttm_object_device's ops, but does so
without releasing the reference acquired by dma_buf_get().  Any
unprivileged renderD client passing a non-vmwgfx prime fd through the
DRM_VMW_GB_SURFACE_REF{,_EXT} path leaks one dma_buf reference per
call and indefinitely pins the foreign exporter's GEM resources.

Funnel the error path through the existing dma_buf_put() so the
reference is always dropped.

Fixes: 65981f7681ab ("drm/ttm: Add a minimal prime implementation for ttm base objects")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-6-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: take fman-&gt;lock around fence list mutation in fifo_down</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=250af2e8c3e90dc978e062a936b633870a22e660'/>
<id>urn:sha1:250af2e8c3e90dc978e062a936b633870a22e660</id>
<content type='text'>
vmw_fence_fifo_down() drops fman-&gt;lock to wait on a fence and, on
timeout, mutates fman-&gt;fence_list via list_del_init() and signals
the fence without re-acquiring the lock.  __vmw_fences_update() walks
and removes entries from the same list under fman-&gt;lock from any
other waiter, the fence-IRQ thread, or vmw_fences_update(), so the
unlocked list_del_init() can corrupt the list head.

Re-take fman-&gt;lock before manipulating fence-&gt;head and use
dma_fence_signal_locked().  Wrap the locked signalling in
dma_fence_begin_signalling() / dma_fence_end_signalling() so the
lockdep annotation that dma_fence_signal() previously provided is
preserved (the same pattern as __vmw_fences_update()).

dma_fence_put() is moved outside the lock to avoid a recursive
acquire from vmw_fence_obj_destroy(), which also takes fman-&gt;lock.

Fixes: ae2a104058e2 ("vmwgfx: Implement fence objects")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-5-zack.rusin@broadcom.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: clamp dirty-page range with min, not max</title>
<updated>2026-07-27T15:29:24+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f47d542d5912f236273399d7139b522f6950e2e4'/>
<id>urn:sha1:f47d542d5912f236273399d7139b522f6950e2e4</id>
<content type='text'>
vmw_bo_dirty_transfer_to_res() and vmw_bo_dirty_clear() compute the
intersection of a resource's page range with the BO's tracked dirty
range, but clamp res_end against dirty-&gt;end with max() instead of
min().  When dirty-&gt;end exceeds the resource end, the loop walks past
the resource's pages, calls vmw_resource_dirty_update() for ranges
owned by other resources sharing the same backing MOB and clears
their pending dirty bits via bitmap_clear().  The result is silent
loss of writeback for unrelated resources whenever two resources
share a MOB.

Use min() in both functions so the loop is bounded to the
intersection of the resource and dirty ranges.

Fixes: b7468b15d271 ("drm/vmwgfx: Implement an infrastructure for write-coherent resources")
Fixes: 965544150d1c ("drm/vmwgfx: Refactor cursor handling")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260505222728.519626-4-zack.rusin@broadcom.com
</content>
</entry>
</feed>
