<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/vmwgfx, branch linux-6.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-08-30T12:52:36Z</updated>
<entry>
<title>drm/vmwgfx: Fix possible invalid drm gem put calls</title>
<updated>2023-08-30T12:52:36Z</updated>
<author>
<name>Zack Rusin</name>
</author>
<published>2023-08-18T04:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6969e4500d86576ee78ecbf3d612e964ca5488ba'/>
<id>urn:sha1:6969e4500d86576ee78ecbf3d612e964ca5488ba</id>
<content type='text'>
commit f9e96bf1905479f18e83a3a4c314a8dfa56ede2c upstream.

vmw_bo_unreference sets the input buffer to null on exit, resulting in
null ptr deref's on the subsequent drm gem put calls.

This went unnoticed because only very old userspace would be exercising
those paths but it wouldn't be hard to hit on old distros with brand
new kernels.

Introduce a new function that abstracts unrefing of user bo's to make
the code cleaner and more explicit.

Signed-off-by: Zack Rusin &lt;zackr@vmware.com&gt;
Reported-by: Ian Forbes &lt;iforbes@vmware.com&gt;
Fixes: 9ef8d83e8e25 ("drm/vmwgfx: Do not drop the reference to the handle too soon")
Cc: &lt;stable@vger.kernel.org&gt; # v6.4+
Reviewed-by: Maaz Mombasawala&lt;mombasawalam@vmware.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230818041301.407636-1-zack@kde.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix shader stage validation</title>
<updated>2023-08-30T12:52:36Z</updated>
<author>
<name>Zack Rusin</name>
</author>
<published>2023-06-16T19:09:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5574b0cbb493f3b3cbb2c381e8e1dac52a70213f'/>
<id>urn:sha1:5574b0cbb493f3b3cbb2c381e8e1dac52a70213f</id>
<content type='text'>
commit 14abdfae508228a7307f7491b5c4215ae70c6542 upstream.

For multiple commands the driver was not correctly validating the shader
stages resulting in possible kernel oopses. The validation code was only.
if ever, checking the upper bound on the shader stages but never a lower
bound (valid shader stages start at 1 not 0).

Fixes kernel oopses ending up in vmw_binding_add, e.g.:
Oops: 0000 [#1] PREEMPT SMP PTI
CPU: 1 PID: 2443 Comm: testcase Not tainted 6.3.0-rc4-vmwgfx #1
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
RIP: 0010:vmw_binding_add+0x4c/0x140 [vmwgfx]
Code: 7e 30 49 83 ff 0e 0f 87 ea 00 00 00 4b 8d 04 7f 89 d2 89 cb 48 c1 e0 03 4c 8b b0 40 3d 93 c0 48 8b 80 48 3d 93 c0 49 0f af de &lt;48&gt; 03 1c d0 4c 01 e3 49 8&gt;
RSP: 0018:ffffb8014416b968 EFLAGS: 00010206
RAX: ffffffffc0933ec0 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 00000000ffffffff RSI: ffffb8014416b9c0 RDI: ffffb8014316f000
RBP: ffffb8014416b998 R08: 0000000000000003 R09: 746f6c735f726564
R10: ffffffffaaf2bda0 R11: 732e676e69646e69 R12: ffffb8014316f000
R13: ffffb8014416b9c0 R14: 0000000000000040 R15: 0000000000000006
FS:  00007fba8c0af740(0000) GS:ffff8a1277c80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000007c0933eb8 CR3: 0000000118244001 CR4: 00000000003706e0
Call Trace:
 &lt;TASK&gt;
 vmw_view_bindings_add+0xf5/0x1b0 [vmwgfx]
 ? ___drm_dbg+0x8a/0xb0 [drm]
 vmw_cmd_dx_set_shader_res+0x8f/0xc0 [vmwgfx]
 vmw_execbuf_process+0x590/0x1360 [vmwgfx]
 vmw_execbuf_ioctl+0x173/0x370 [vmwgfx]
 ? __drm_dev_dbg+0xb4/0xe0 [drm]
 ? __pfx_vmw_execbuf_ioctl+0x10/0x10 [vmwgfx]
 drm_ioctl_kernel+0xbc/0x160 [drm]
 drm_ioctl+0x2d2/0x580 [drm]
 ? __pfx_vmw_execbuf_ioctl+0x10/0x10 [vmwgfx]
 ? do_fault+0x1a6/0x420
 vmw_generic_ioctl+0xbd/0x180 [vmwgfx]
 vmw_unlocked_ioctl+0x19/0x20 [vmwgfx]
 __x64_sys_ioctl+0x96/0xd0
 do_syscall_64+0x5d/0x90
 ? handle_mm_fault+0xe4/0x2f0
 ? debug_smp_processor_id+0x1b/0x30
 ? fpregs_assert_state_consistent+0x2e/0x50
 ? exit_to_user_mode_prepare+0x40/0x180
 ? irqentry_exit_to_user_mode+0xd/0x20
 ? irqentry_exit+0x3f/0x50
 ? exc_page_fault+0x8b/0x180
 entry_SYSCALL_64_after_hwframe+0x72/0xdc

Signed-off-by: Zack Rusin &lt;zackr@vmware.com&gt;
Cc: security@openanolis.org
Reported-by: Ziming Zhang &lt;ezrakiez@gmail.com&gt;
Testcase-found-by: Niels De Graef &lt;ndegraef@redhat.com&gt;
Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support")
Cc: &lt;stable@vger.kernel.org&gt; # v4.3+
Reviewed-by: Maaz Mombasawala&lt;mombasawalam@vmware.com&gt;
Reviewed-by: Martin Krastev &lt;krastevm@vmware.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230616190934.54828-1-zack@kde.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'flex-array-transformations-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux</title>
<updated>2023-04-26T15:25:57Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2023-04-26T15:25:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98f99e67a1dc456e9a542584819b2aa265ffc737'/>
<id>urn:sha1:98f99e67a1dc456e9a542584819b2aa265ffc737</id>
<content type='text'>
Pull flexible-array updates from Gustavo Silva:
 "Transform more zero-length and one-element arrays into C99
  flexible-array members"

* tag 'flex-array-transformations-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
  uapi: net: ipv6: Replace fake flex-array with flex-array member
  drm/vmwgfx: Replace one-element array with flexible-array member
  ASoC: uapi: Replace zero-length arrays with __DECLARE_FLEX_ARRAY() helper
</content>
</entry>
<entry>
<title>drm/vmwgfx: remove unused vmw_overlay function</title>
<updated>2023-04-11T17:48:55Z</updated>
<author>
<name>Tom Rix</name>
</author>
<published>2023-03-21T18:24:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd35174e13f98f9232c4aa66689816731d34ca28'/>
<id>urn:sha1:fd35174e13f98f9232c4aa66689816731d34ca28</id>
<content type='text'>
clang with W=1 reports
drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c:56:35: error:
  unused function 'vmw_overlay' [-Werror,-Wunused-function]
static inline struct vmw_overlay *vmw_overlay(struct drm_device *dev)
                                  ^
This function is not used, so remove it.

Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Reviewed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Signed-off-by: Zack Rusin &lt;zackr@vmware.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230321182414.1826372-1-trix@redhat.com
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix Legacy Display Unit atomic drm support</title>
<updated>2023-04-11T16:29:30Z</updated>
<author>
<name>Martin Krastev</name>
</author>
<published>2023-03-21T02:09:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a37a512db3fa1b65fe9087003e5b2072cefb3667'/>
<id>urn:sha1:a37a512db3fa1b65fe9087003e5b2072cefb3667</id>
<content type='text'>
Legacy Display Unit (LDU) fb dirty support used a custom fb dirty callback. Latter
handled only the DIRTYFB IOCTL presentation path but not the ADDFB2/PAGE_FLIP/RMFB
IOCTL path, common for Wayland compositors.

Get rid of the custom callback in favor of drm_atomic_helper_dirtyfb and unify the
handling of the presentation paths inside of vmw_ldu_primary_plane_atomic_update.
This also homogenizes the fb dirty callbacks across all DUs: LDU, SOU and STDU.

Signed-off-by: Martin Krastev &lt;krastevm@vmware.com&gt;
Reviewed-by: Maaz Mombasawala &lt;mombasawalam@vmware.com&gt;
Fixes: 2f5544ff0300 ("drm/vmwgfx: Use atomic helper function for dirty fb IOCTL")
Cc: &lt;stable@vger.kernel.org&gt; # v5.0+
Signed-off-by: Zack Rusin &lt;zackr@vmware.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230321020949.335012-3-zack@kde.org
</content>
</entry>
<entry>
<title>drm/vmwgfx: Print errors when running on broken/unsupported configs</title>
<updated>2023-04-11T16:29:30Z</updated>
<author>
<name>Zack Rusin</name>
</author>
<published>2023-03-21T02:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=35d86fb626a2554de5d5916b6e2d47d06b483d37'/>
<id>urn:sha1:35d86fb626a2554de5d5916b6e2d47d06b483d37</id>
<content type='text'>
virtualbox implemented an incomplete version of the svga device which
they decided to drop soon after the initial release. The device was
always broken in various ways and never supported by vmwgfx.

vmwgfx should refuse to load on those configurations but currently
drm has no way of reloading fbdev when the specific pci driver refuses
to load, which would leave users without a usable fb. Instead of
refusing to load print an error and disable a bunch of functionality
that virtualbox never implemented to at least get fb to work on their
setup.

Signed-off-by: Zack Rusin &lt;zackr@vmware.com&gt;
Reviewed-by: Martin Krastev &lt;krastevm@vmware.com&gt;
Reviewed-by: Maaz Mombasawala &lt;mombasawalam@vmware.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230321020949.335012-2-zack@kde.org
</content>
</entry>
<entry>
<title>drm/vmwgfx: Drop mksstat_init_record fn as currently unused</title>
<updated>2023-04-11T16:29:30Z</updated>
<author>
<name>Martin Krastev</name>
</author>
<published>2023-03-21T02:09:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=490438469d493e8f764bea14d47eaf4c2ae7cc80'/>
<id>urn:sha1:490438469d493e8f764bea14d47eaf4c2ae7cc80</id>
<content type='text'>
This internal helper handles a type of mksstat event counter
which is currently unused. Remove the routine to avoid compile
warnings.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Martin Krastev &lt;krastevm@vmware.com&gt;
Reviewed-by: Maaz Mombasawala &lt;mombasawalam@vmware.com&gt;
Reviewed-by: Zack Rusin &lt;zackr@vmware.com&gt;
Signed-off-by: Zack Rusin &lt;zackr@vmware.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230321020949.335012-1-zack@kde.org
</content>
</entry>
<entry>
<title>drm/fbdev-generic: Remove unused prefer_shadow_fbdev flag</title>
<updated>2023-03-22T12:32:47Z</updated>
<author>
<name>Thomas Zimmermann</name>
</author>
<published>2023-03-20T15:07:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7423740b2515a4c8a70ccdc068c0ac4a2610a23d'/>
<id>urn:sha1:7423740b2515a4c8a70ccdc068c0ac4a2610a23d</id>
<content type='text'>
Remove the flag prefer_shadow_fbdev from struct drm_mode_config.
Drivers set this flag to enable shadow buffering in the generic
fbdev emulation. Such shadow buffering is now mandatory, so the
flag is unused.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Zack Rusin &lt;zackr@vmware.com&gt;
Tested-by: Sui Jingfeng &lt;suijingfeng@loongson.cn&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230320150751.20399-3-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix src/dst_pitch confusion</title>
<updated>2023-03-15T20:15:25Z</updated>
<author>
<name>Zack Rusin</name>
</author>
<published>2023-03-14T21:14:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=328839ff93709a517e89ba1de1132c5d138e5dcb'/>
<id>urn:sha1:328839ff93709a517e89ba1de1132c5d138e5dcb</id>
<content type='text'>
The src/dst_pitch got mixed up during the rework of the function, make
sure the offset's refer to the correct one.

Spotted by clang:
Clang warns (or errors with CONFIG_WERROR):

  drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c:509:29: error: variable 'dst_pitch' is uninitialized when used here [-Werror,-Wuninitialized]
          src_offset = ddirty-&gt;top * dst_pitch + ddirty-&gt;left * stdu-&gt;cpp;
                                     ^~~~~~~~~
  drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c:492:26: note: initialize the variable 'dst_pitch' to silence this warning
          s32 src_pitch, dst_pitch;
                                  ^
                                   = 0
  1 error generated.

Signed-off-by: Zack Rusin &lt;zackr@vmware.com&gt;
Reported-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reported-by: Dave Airlie &lt;airlied@gmail.com&gt;
Link: https://github.com/ClangBuiltLinux/linux/issues/1811
Fixes: 39985eea5a6d ("drm/vmwgfx: Abstract placement selection")
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Martin Krastev &lt;krastevm@vmware.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230314211445.1363828-1-zack@kde.org
</content>
</entry>
<entry>
<title>drm: Track clients by tgid and not tid</title>
<updated>2023-03-15T13:03:00Z</updated>
<author>
<name>Tvrtko Ursulin</name>
</author>
<published>2023-03-14T14:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4230cea89cafb11b2c2e4dcac8b505e7a766b386'/>
<id>urn:sha1:4230cea89cafb11b2c2e4dcac8b505e7a766b386</id>
<content type='text'>
Thread group id (aka pid from userspace point of view) is a more
interesting thing to show as an owner of a DRM fd, so track and show that
instead of the thread id.

In the next patch we will make the owner updated post file descriptor
handover, which will also be tgid based to avoid ping-pong when multiple
threads access the fd.

Signed-off-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Reviewed-by: Zack Rusin &lt;zackr@vmware.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230314141904.1210824-2-tvrtko.ursulin@linux.intel.com
</content>
</entry>
</feed>
