]> Git Repo - linux.git/commit
drm/vmwgfx: Fix possible invalid drm gem put calls
authorZack Rusin <[email protected]>
Fri, 18 Aug 2023 04:13:01 +0000 (00:13 -0400)
committerZack Rusin <[email protected]>
Wed, 23 Aug 2023 17:20:04 +0000 (13:20 -0400)
commitf9e96bf1905479f18e83a3a4c314a8dfa56ede2c
treee66f797c55073d1c284fb802f5a9f78e5c9db7ae
parent14abdfae508228a7307f7491b5c4215ae70c6542
drm/vmwgfx: Fix possible invalid drm gem put calls

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 <[email protected]>
Reported-by: Ian Forbes <[email protected]>
Fixes: 9ef8d83e8e25 ("drm/vmwgfx: Do not drop the reference to the handle too soon")
Cc: <[email protected]> # v6.4+
Reviewed-by: Maaz Mombasawala<[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
drivers/gpu/drm/vmwgfx/vmwgfx_bo.h
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
This page took 0.056875 seconds and 4 git commands to generate.