WSL2-Linux-Kernel/drivers/dma-buf
Christian König a3f7c10a26 dma-buf/dma-resv: check if the new fence is really later
Previously when we added a fence to a dma_resv object we always
assumed the the newer than all the existing fences.

With Jason's work to add an UAPI to explicit export/import that's not
necessary the case any more. So without this check we would allow
userspace to force the kernel into an use after free error.

Since the change is very small and defensive it's probably a good
idea to backport this to stable kernels as well just in case others
are using the dma_resv object in the same way.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220810172617.140047-1-christian.koenig@amd.com
Cc: stable@vger.kernel.org # v5.19+
2022-08-25 13:10:30 +02:00
..
heaps dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
Kconfig dma-buf: deprecate DMABUF_SYSFS_STATS 2022-06-23 10:51:43 +02:00
Makefile dma-buf: cleanup dma_fence_unwrap implementation 2022-05-30 14:16:32 +02:00
dma-buf-sysfs-stats.c
dma-buf-sysfs-stats.h
dma-buf.c drm for 5.20/6.0 2022-08-03 19:52:08 -07:00
dma-fence-array.c dma-buf: handle empty dma_fence_arrays gracefully 2022-03-29 09:14:30 +02:00
dma-fence-chain.c dma-buf: cleanup dma_fence_chain_walk 2022-05-30 11:24:50 +02:00
dma-fence-unwrap.c dma-buf: revert "return only unsignaled fences in dma_fence_unwrap_for_each v3" 2022-07-14 14:41:30 +02:00
dma-fence.c
dma-heap.c
dma-resv.c dma-buf/dma-resv: check if the new fence is really later 2022-08-25 13:10:30 +02:00
selftest.c
selftest.h
selftests.h dma-buf: add dma_fence_unwrap v2 2022-03-25 14:18:28 +01:00
st-dma-fence-chain.c
st-dma-fence-unwrap.c dma-buf: generalize dma_fence unwrap & merging v3 2022-05-30 14:24:04 +02:00
st-dma-fence.c
st-dma-resv.c dma-buf: drop seq count based update 2022-04-07 12:53:54 +02:00
sw_sync.c
sync_debug.c
sync_debug.h
sync_file.c dma-buf: generalize dma_fence unwrap & merging v3 2022-05-30 14:24:04 +02:00
sync_trace.h
udmabuf.c Linux 5.19-rc6 2022-07-13 10:54:56 +10:00