aboutsummaryrefslogtreecommitdiff
path: root/lib/crypto/mpi/mpi-bit.c
diff options
context:
space:
mode:
authorZack Rusin <zack.rusin@broadcom.com>2024-08-16 14:32:05 -0400
committerZack Rusin <zack.rusin@broadcom.com>2024-08-26 00:19:40 -0400
commitaba07b9a0587f50e5d3346eaa19019cf3f86c0ea (patch)
treeb40756c01fc30a00746e30ab5ee6324b5a280a07 /lib/crypto/mpi/mpi-bit.c
parentc358a809cb58af944d496944391a240e02f5837a (diff)
drm/vmwgfx: Prevent unmapping active read buffers
The kms paths keep a persistent map active to read and compare the cursor buffer. These maps can race with each other in simple scenario where: a) buffer "a" mapped for update b) buffer "a" mapped for compare c) do the compare d) unmap "a" for compare e) update the cursor f) unmap "a" for update At step "e" the buffer has been unmapped and the read contents is bogus. Prevent unmapping of active read buffers by simply keeping a count of how many paths have currently active maps and unmap only when the count reaches 0. Fixes: 485d98d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4") Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com> Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v5.19+ Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240816183332.31961-2-zack.rusin@broadcom.com Reviewed-by: Martin Krastev <martin.krastev@broadcom.com> Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Diffstat (limited to 'lib/crypto/mpi/mpi-bit.c')
0 files changed, 0 insertions, 0 deletions