<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/vmwgfx, branch linux-5.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-09-16T06:23:18Z</updated>
<entry>
<title>drm/vmwgfx: Fix double free in vmw_recv_msg()</title>
<updated>2019-09-16T06:23:18Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2019-08-15T08:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee116fa6327210a0fef8830d21882768c800e168'/>
<id>urn:sha1:ee116fa6327210a0fef8830d21882768c800e168</id>
<content type='text'>
commit 08b0c891605acf727e43e3e03a25857d3e789b61 upstream.

We recently added a kfree() after the end of the loop:

	if (retries == RETRIES) {
		kfree(reply);
		return -EINVAL;
	}

There are two problems.  First the test is wrong and because retries
equals RETRIES if we succeed on the last iteration through the loop.
Second if we fail on the last iteration through the loop then the kfree
is a double free.

When you're reading this code, please note the break statement at the
end of the while loop.  This patch changes the loop so that if it's not
successful then "reply" is NULL and we can test for that afterward.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 6b7c3b86f0b6 ("drm/vmwgfx: fix memory leak when too many retries have occurred")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drm/vmwgfx: fix memory leak when too many retries have occurred</title>
<updated>2019-08-29T06:30:18Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2019-06-24T16:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bcc19f380ecc16710e2fc5bafd945c68f719a96c'/>
<id>urn:sha1:bcc19f380ecc16710e2fc5bafd945c68f719a96c</id>
<content type='text'>
[ Upstream commit 6b7c3b86f0b63134b2ab56508921a0853ffa687a ]

Currently when too many retries have occurred there is a memory
leak on the allocation for reply on the error return path. Fix
this by kfree'ing reply before returning.

Addresses-Coverity: ("Resource leak")
Fixes: a9cd9c044aa9 ("drm/vmwgfx: Add a check to handle host message failure")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Reviewed-by: Deepak Rawat &lt;drawat@vmware.com&gt;
Signed-off-by: Deepak Rawat &lt;drawat@vmware.com&gt;
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: fix a warning due to missing dma_parms</title>
<updated>2019-06-11T15:00:53Z</updated>
<author>
<name>Qian Cai</name>
</author>
<published>2019-06-03T20:44:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=39916897cd815a0ee07ba1f6820cf88a63e459fc'/>
<id>urn:sha1:39916897cd815a0ee07ba1f6820cf88a63e459fc</id>
<content type='text'>
Booting up with DMA_API_DEBUG_SG=y generates a warning due to the driver
forgot to set dma_parms appropriately. Set it just after vmw_dma_masks()
in vmw_driver_load().

DMA-API: vmwgfx 0000:00:0f.0: mapping sg segment longer than device
claims to support [len=2097152] [max=65536]
WARNING: CPU: 2 PID: 261 at kernel/dma/debug.c:1232
debug_dma_map_sg+0x360/0x480
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop
Reference Platform, BIOS 6.00 04/13/2018
RIP: 0010:debug_dma_map_sg+0x360/0x480
Call Trace:
 vmw_ttm_map_dma+0x3b1/0x5b0 [vmwgfx]
 vmw_bo_map_dma+0x25/0x30 [vmwgfx]
 vmw_otables_setup+0x2a8/0x750 [vmwgfx]
 vmw_request_device_late+0x78/0xc0 [vmwgfx]
 vmw_request_device+0xee/0x4e0 [vmwgfx]
 vmw_driver_load.cold+0x757/0xd84 [vmwgfx]
 drm_dev_register+0x1ff/0x340 [drm]
 drm_get_pci_dev+0x110/0x290 [drm]
 vmw_probe+0x15/0x20 [vmwgfx]
 local_pci_probe+0x7a/0xc0
 pci_device_probe+0x1b9/0x290
 really_probe+0x1b5/0x630
 driver_probe_device+0xa3/0x1a0
 device_driver_attach+0x94/0xa0
 __driver_attach+0xdd/0x1c0
 bus_for_each_dev+0xfe/0x150
 driver_attach+0x2d/0x40
 bus_add_driver+0x290/0x350
 driver_register+0xdc/0x1d0
 __pci_register_driver+0xda/0xf0
 vmwgfx_init+0x34/0x1000 [vmwgfx]
 do_one_initcall+0xe5/0x40a
 do_init_module+0x10f/0x3a0
 load_module+0x16a5/0x1a40
 __se_sys_finit_module+0x183/0x1c0
 __x64_sys_finit_module+0x43/0x50
 do_syscall_64+0xc8/0x606
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU")
Co-developed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Qian Cai &lt;cai@lca.pw&gt;
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Honor the sg list segment size limitation</title>
<updated>2019-06-11T15:00:23Z</updated>
<author>
<name>Thomas Hellstrom</name>
</author>
<published>2019-06-04T11:54:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bde15555ba61c7f664f40fd3c6fdbdb63f784c9b'/>
<id>urn:sha1:bde15555ba61c7f664f40fd3c6fdbdb63f784c9b</id>
<content type='text'>
When building sg tables, honor the device sg list segment size limitation.

Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Deepak Rawat &lt;drawat@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Use the backdoor port if the HB port is not available</title>
<updated>2019-06-11T14:59:54Z</updated>
<author>
<name>Thomas Hellstrom</name>
</author>
<published>2019-05-29T06:15:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc0ba0d8624f210995924bb57a8b181ce8976606'/>
<id>urn:sha1:cc0ba0d8624f210995924bb57a8b181ce8976606</id>
<content type='text'>
The HB port may not be available for various reasons. Either it has been
disabled by a config option or by the hypervisor for other reasons.
In that case, make sure we have a backup plan and use the backdoor port
instead with a performance penalty.

Cc: stable@vger.kernel.org
Fixes: 89da76fde68d ("drm/vmwgfx: Add VMWare host messaging capability")
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Deepak Rawat &lt;drawat@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: integer underflow in vmw_cmd_dx_set_shader() leading to an invalid read</title>
<updated>2019-05-21T08:23:10Z</updated>
<author>
<name>Murray McAllister</name>
</author>
<published>2019-05-20T09:57:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ed7f4b5eca11c3c69e7c8b53e4321812bc1ee1e'/>
<id>urn:sha1:5ed7f4b5eca11c3c69e7c8b53e4321812bc1ee1e</id>
<content type='text'>
If SVGA_3D_CMD_DX_SET_SHADER is called with a shader ID
of SVGA3D_INVALID_ID, and a shader type of
SVGA3D_SHADERTYPE_INVALID, the calculated binding.shader_slot
will be 4294967295, leading to an out-of-bounds read in vmw_binding_loc()
when the offset is calculated.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support")
Signed-off-by: Murray McAllister &lt;murray.mcallister@gmail.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define()</title>
<updated>2019-05-21T08:23:10Z</updated>
<author>
<name>Murray McAllister</name>
</author>
<published>2019-05-11T06:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bcd6aa7b6cbfd6f985f606c6f76046d782905820'/>
<id>urn:sha1:bcd6aa7b6cbfd6f985f606c6f76046d782905820</id>
<content type='text'>
If SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW is called with a surface
ID of SVGA3D_INVALID_ID, the srf struct will remain NULL after
vmw_cmd_res_check(), leading to a null pointer dereference in
vmw_view_add().

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support")
Signed-off-by: Murray McAllister &lt;murray.mcallister@gmail.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Use the dma scatter-gather iterator to get dma addresses</title>
<updated>2019-05-21T08:23:09Z</updated>
<author>
<name>Thomas Hellstrom</name>
</author>
<published>2019-05-15T15:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8dc39cfca32c9a4e6deddaa0e76bd47d56f1876b'/>
<id>urn:sha1:8dc39cfca32c9a4e6deddaa0e76bd47d56f1876b</id>
<content type='text'>
Use struct sg_dma_page_iter in favour struct of sg_page_iter, which fairly
recently was declared useless for obtaining dma addresses.

With a struct sg_dma_page_iter we can't call sg_page_iter_page() so
when the page is needed, use the same page lookup mechanism as for the
non-sg dma modes instead of calling sg_dma_page_iter.

Note, the fixes tag doesn't really point to a commit introducing a
failure / regression, but rather to a commit that implemented a simple
workaround for this problem.

Cc: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Fixes: d901b2760dc6 ("lib/scatterlist: Provide a DMA page iterator")
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix compat mode shader operation</title>
<updated>2019-05-21T08:23:09Z</updated>
<author>
<name>Thomas Hellstrom</name>
</author>
<published>2019-04-04T13:25:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e41c20cf50a8a7d0dfa337a7530590aacef4193b'/>
<id>urn:sha1:e41c20cf50a8a7d0dfa337a7530590aacef4193b</id>
<content type='text'>
In compat mode, we allowed host-backed user-space with guest-backed
kernel / device. In this mode, set shader commands was broken since
no relocations were emitted. Fix this.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: e8c66efbfe3a ("drm/vmwgfx: Make user resource lookups reference-free during validation")
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Brian Paul &lt;brianp@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix user space handle equal to zero</title>
<updated>2019-05-21T08:23:09Z</updated>
<author>
<name>Thomas Hellstrom</name>
</author>
<published>2019-05-07T09:10:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8407f8a1d940fe28c4243ad4f0cb6a44dcee88f6'/>
<id>urn:sha1:8407f8a1d940fe28c4243ad4f0cb6a44dcee88f6</id>
<content type='text'>
User-space handles equal to zero are interpreted as uninitialized or
illegal by some drm systems (most notably kms). This means that a
dumb buffer or surface with a zero user-space handle can never be
used as a kms frame-buffer.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: c7eae62666ad ("drm/vmwgfx: Make the object handles idr-generated")
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Deepak Rawat &lt;drawat@vmware.com&gt;
</content>
</entry>
</feed>
