diff options
author | Rob Clark <robdclark@chromium.org> | 2023-08-18 07:59:38 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-30 16:31:56 +0200 |
commit | aee58f4d80e9987ab89929726cc782b03ae74fe3 (patch) | |
tree | a34d7c4879d9865b9a9ee98d539825b73c8b5e2d /Makefile | |
parent | 92e79e1c0fdd233b67880c9edb17d2c8e4beae6b (diff) | |
download | linux-stable-aee58f4d80e9987ab89929726cc782b03ae74fe3.tar.gz linux-stable-aee58f4d80e9987ab89929726cc782b03ae74fe3.tar.bz2 linux-stable-aee58f4d80e9987ab89929726cc782b03ae74fe3.zip |
dma-buf/sw_sync: Avoid recursive lock during fence signal
[ Upstream commit e531fdb5cd5ee2564b7fe10c8a9219e2b2fac61e ]
If a signal callback releases the sw_sync fence, that will trigger a
deadlock as the timeline_fence_release recurses onto the fence->lock
(used both for signaling and the the timeline tree).
To avoid that, temporarily hold an extra reference to the signalled
fences until after we drop the lock.
(This is an alternative implementation of https://patchwork.kernel.org/patch/11664717/
which avoids some potential UAF issues with the original patch.)
v2: Remove now obsolete comment, use list_move_tail() and
list_del_init()
Reported-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: d3c6dd1fb30d ("dma-buf/sw_sync: Synchronize signal vs syncpt free")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230818145939.39697-1-robdclark@gmail.com
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions