Loading
drm/vmwgfx: Remove rcu locks from user resources
mainline inclusion from mainline-v6.2-rc4 commit a309c719 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IALIFE CVE: CVE-2022-48887 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a309c7194e8a2f8bd4539b9449917913f6c2cd50 -------------------------------- User resource lookups used rcu to avoid two extra atomics. Unfortunately the rcu paths were buggy and it was easy to make the driver crash by submitting command buffers from two different threads. Because the lookups never show up in performance profiles replace them with a regular spin lock which fixes the races in accesses to those shared resources. Fixes kernel oops'es in IGT's vmwgfx execution_buffer stress test and seen crashes with apps using shared resources. Fixes: e14c02e6 ("drm/vmwgfx: Look up objects without taking a reference") Signed-off-by:Zack Rusin <zackr@vmware.com> Reviewed-by:
Martin Krastev <krastevm@vmware.com> Reviewed-by:
Maaz Mombasawala <mombasawalam@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221207172907.959037-1-zack@kde.org Conflicts: drivers/gpu/drm/vmwgfx/ttm_object.c drivers/gpu/drm/vmwgfx/ttm_object.h drivers/gpu/drm/vmwgfx/vmwgfx_bo.c drivers/gpu/drm/vmwgfx/vmwgfx_drv.h drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c drivers/gpu/drm/vmwgfx/vmwgfx_resource.c [Huang Xiaojia adapts context conflicts] Signed-off-by:
Huang Xiaojia <huangxiaojia2@huawei.com>