diff options
author | Zack Rusin <zackr@vmware.com> | 2023-08-18 00:13:01 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2023-08-23 13:20:04 -0400 |
commit | f9e96bf1905479f18e83a3a4c314a8dfa56ede2c (patch) | |
tree | e66f797c55073d1c284fb802f5a9f78e5c9db7ae /include | |
parent | 14abdfae508228a7307f7491b5c4215ae70c6542 (diff) | |
download | lwn-f9e96bf1905479f18e83a3a4c314a8dfa56ede2c.tar.gz lwn-f9e96bf1905479f18e83a3a4c314a8dfa56ede2c.zip |
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 <zackr@vmware.com>
Reported-by: Ian Forbes <iforbes@vmware.com>
Fixes: 9ef8d83e8e25 ("drm/vmwgfx: Do not drop the reference to the handle too soon")
Cc: <stable@vger.kernel.org> # v6.4+
Reviewed-by: Maaz Mombasawala<mombasawalam@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230818041301.407636-1-zack@kde.org
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions