summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/meson
diff options
context:
space:
mode:
authorSteven Price <steven.price@arm.com>2022-12-19 17:01:30 +0300
committerSteven Price <steven.price@arm.com>2022-12-21 18:04:42 +0300
commit4217c6ac817451d5116687f3cc6286220dc43d49 (patch)
treef615a26607d8077e1b5423f8715052032cf7ab10 /drivers/gpu/drm/meson
parent4e699e34f923188175986ad8a74ab99f7034075e (diff)
downloadlinux-4217c6ac817451d5116687f3cc6286220dc43d49.tar.xz
drm/panfrost: Fix GEM handle creation ref-counting
panfrost_gem_create_with_handle() previously returned a BO but with the only reference being from the handle, which user space could in theory guess and release, causing a use-after-free. Additionally if the call to panfrost_gem_mapping_get() in panfrost_ioctl_create_bo() failed then a(nother) reference on the BO was dropped. The _create_with_handle() is a problematic pattern, so ditch it and instead create the handle in panfrost_ioctl_create_bo(). If the call to panfrost_gem_mapping_get() fails then this means that user space has indeed gone behind our back and freed the handle. In which case just return an error code. Reported-by: Rob Clark <robdclark@chromium.org> Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") Signed-off-by: Steven Price <steven.price@arm.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221219140130.410578-1-steven.price@arm.com
Diffstat (limited to 'drivers/gpu/drm/meson')
0 files changed, 0 insertions, 0 deletions