<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/vmwgfx, branch v6.6.155</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.155</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.155'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-08-09T18:22:00+00:00</updated>
<entry>
<title>drm/vmwgfx: validate external BO copy bounds for both stride paths</title>
<updated>2026-08-09T18:22:00+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=4e0f669e2951b742239c6fe847fcc406fe78748d'/>
<id>urn:sha1:4e0f669e2951b742239c6fe847fcc406fe78748d</id>
<content type='text'>
commit 706c93c5813caabbb0d0a576c017d15aeec2c113 upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: use check_add_overflow for shader size+offset bound</title>
<updated>2026-08-09T18:22:00+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=1bbe7751f5ebac383405ef29a66622d65bd505d3'/>
<id>urn:sha1:1bbe7751f5ebac383405ef29a66622d65bd505d3</id>
<content type='text'>
commit 54d56d5b42d2e4c72ba6e365e9774da90698aa22 upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: bound DMA command body size against suffix pointer</title>
<updated>2026-08-09T18:22:00+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=036e16ada95389bdc30f41068af04c1d0872fad0'/>
<id>urn:sha1:036e16ada95389bdc30f41068af04c1d0872fad0</id>
<content type='text'>
commit f4f1db96bfd68b81053693ba53405b6f510ac16c upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: validate DRAW_PRIMITIVES header size before division</title>
<updated>2026-08-09T18:22:00+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=2666cddf0dd218aa9bd1f99db688d1b532eac21a'/>
<id>urn:sha1:2666cddf0dd218aa9bd1f99db688d1b532eac21a</id>
<content type='text'>
commit 85891d174707d8bddcec7a888fb4e1d17def34f3 upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: drop dma_buf reference on foreign-fd prime import</title>
<updated>2026-08-09T18:22:00+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=c1c22fca0a0896a452a7cb92422d67babd65b4be'/>
<id>urn:sha1:c1c22fca0a0896a452a7cb92422d67babd65b4be</id>
<content type='text'>
commit f739416dc555fa205a785e5135d73fa39b26f35d upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: reject DX_BIND_QUERY without a DX context</title>
<updated>2026-08-09T18:21:59+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7eae011829f94a76470ec76f016805f508437755'/>
<id>urn:sha1:7eae011829f94a76470ec76f016805f508437755</id>
<content type='text'>
commit 55ec09c9ce10b1272802c7ab6c1be2ea0dbc68db upstream.

vmw_cmd_dx_bind_query() unconditionally dereferences
sw_context-&gt;dx_ctx_node-&gt;ctx.  Userspace can trigger a NULL pointer
dereference from any render-node fd by submitting an execbuf with
dx_context_handle == SVGA3D_INVALID_ID and a SVGA_3D_CMD_DX_BIND_QUERY
opcode in the command stream: dx_ctx_node is left NULL and the kernel
oopses on the assignment.  The same NULL is then re-read in
vmw_resources_reserve() via vmw_context_get_dx_query_mob().

All sibling DX handlers fail-close on a missing dx_ctx_node using
VMW_GET_CTX_NODE().  Use the same pattern here, returning -EINVAL up
front before any relocation state is published.

Fixes: 9c079b8ce8bf ("drm/vmwgfx: Adapt execbuf to the new validation api")
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-3-zack.rusin@broadcom.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: fix guest_memory_dirty bitfield clobbered as size</title>
<updated>2026-08-09T18:21:59+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-05-05T22:22:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=21bbe38faee4a195d33a93e3908e307807f7745d'/>
<id>urn:sha1:21bbe38faee4a195d33a93e3908e307807f7745d</id>
<content type='text'>
commit 83195b778f2d109a3a4f3ffaba4dce7e4cdb58aa upstream.

Two sites in vmwgfx_resource.c assign boolean literals to
res-&gt;guest_memory_size, which is an unsigned long allocation-size
field; the intended target is the adjacent res-&gt;guest_memory_dirty
bitfield.  After the assignments the field holds 0 or 1 instead of
the resource's MOB allocation size:

  - vmw_resource_release()       writes 0 (false), and
  - vmw_resource_unbind_list()   writes 1 (true).

Subsequent revalidation paths read guest_memory_size when computing
the dirty page range (vmw_bo_dirty_transfer_to_res()) and the buffer
allocation size (vmw_resource_buf_alloc()), producing zero-length
walks or wrap-around ranges that read or write past the MOB bitmap.
The dirty-tracking intent of the original code (mark the resource as
dirtied since the last sync) is also lost, since guest_memory_dirty
is never updated.

Rename both assignments to guest_memory_dirty.

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-2-zack.rusin@broadcom.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Validate vmw_surface_metadata::array_size</title>
<updated>2026-08-03T09:15:25+00:00</updated>
<author>
<name>Ian Forbes</name>
<email>ian.forbes@broadcom.com</email>
</author>
<published>2026-06-23T19:33:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ff94e1279176b539d451e3e754fdcbd1a8d520a'/>
<id>urn:sha1:5ff94e1279176b539d451e3e754fdcbd1a8d520a</id>
<content type='text'>
commit a4f55260f7f7d4dc4d0ee55063dfb0c457b77991 upstream.

This field comes from userspace and should be validated against specific
limits depending on which Shader Model (SM) is available.

Fixes: 504901dbb0b5 ("drm/vmwgfx: Refactor surface_define to use vmw_surface_metadata")
Reported-by: Zero Day Initiative &lt;zdi-disclosures@trendmicro.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260623193314.506257-1-ian.forbes@broadcom.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Return the correct value in vmw_translate_ptr functions</title>
<updated>2026-03-25T10:05:29+00:00</updated>
<author>
<name>Ian Forbes</name>
<email>ian.forbes@broadcom.com</email>
</author>
<published>2026-01-13T17:53:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7e55d0788b362c93660b80cc5603031bbbdefa98'/>
<id>urn:sha1:7e55d0788b362c93660b80cc5603031bbbdefa98</id>
<content type='text'>
[ Upstream commit 5023ca80f9589295cb60735016e39fc5cc714243 ]

Before the referenced fixes these functions used a lookup function that
returned a pointer. This was changed to another lookup function that
returned an error code with the pointer becoming an out parameter.

The error path when the lookup failed was not changed to reflect this
change and the code continued to return the PTR_ERR of the now
uninitialized pointer. This could cause the vmw_translate_ptr functions
to return success when they actually failed causing further uninitialized
and OOB accesses.

Reported-by: Kuzey Arda Bulut &lt;kuzeyardabulut@gmail.com&gt;
Fixes: a309c7194e8a ("drm/vmwgfx: Remove rcu locks from user resources")
Signed-off-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260113175357.129285-1-ian.forbes@broadcom.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix invalid kref_put callback in vmw_bo_dirty_release</title>
<updated>2026-03-25T10:05:29+00:00</updated>
<author>
<name>Brad Spengler</name>
<email>brad.spengler@opensrcsec.com</email>
</author>
<published>2026-01-07T17:12:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2106a0153b5dac983a9562d7bab91c7e693106f7'/>
<id>urn:sha1:2106a0153b5dac983a9562d7bab91c7e693106f7</id>
<content type='text'>
[ Upstream commit 211ecfaaef186ee5230a77d054cdec7fbfc6724a ]

The kref_put() call uses (void *)kvfree as the release callback, which
is incorrect. kref_put() expects a function with signature
void (*release)(struct kref *), but kvfree has signature
void (*)(const void *). Calling through an incompatible function pointer
is undefined behavior.

The code only worked by accident because ref_count is the first member
of vmw_bo_dirty, making the kref pointer equal to the struct pointer.

Fix this by adding a proper release callback that uses container_of()
to retrieve the containing structure before freeing.

Fixes: c1962742ffff ("drm/vmwgfx: Use kref in vmw_bo_dirty")
Signed-off-by: Brad Spengler &lt;brad.spengler@opensrcsec.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Cc: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Link: https://patch.msgid.link/20260107171236.3573118-1-zack.rusin@broadcom.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
