linux-stable/drivers/dma-buf
Pavel Sakharov 0336995512 dma-buf: Fix NULL pointer dereference in sanitycheck()
[ Upstream commit 2295bd8467 ]

If due to a memory allocation failure mock_chain() returns NULL, it is
passed to dma_fence_enable_sw_signaling() resulting in NULL pointer
dereference there.

Call dma_fence_enable_sw_signaling() only if mock_chain() succeeds.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: d62c43a953 ("dma-buf: Enable signaling on fence for selftests")
Signed-off-by: Pavel Sakharov <p.sakharov@ispras.ru>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240319231527.1821372-1-p.sakharov@ispras.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:28:21 +02:00
..
heaps
Kconfig
Makefile
dma-buf-sysfs-stats.c dma-buf: fix dma_buf_export init order v2 2023-01-24 07:24:30 +01:00
dma-buf-sysfs-stats.h dma-buf: fix dma_buf_export init order v2 2023-01-24 07:24:30 +01:00
dma-buf.c dma-buf: Add unlocked variant of attachment-mapping functions 2023-09-23 11:11:08 +02:00
dma-fence-array.c
dma-fence-chain.c
dma-fence-unwrap.c dma-buf: add dma_fence_timestamp helper 2023-10-19 23:08:57 +02:00
dma-fence.c dma-buf: fix an error pointer vs NULL bug 2023-08-03 10:24:19 +02:00
dma-heap.c dma-buf: fix racing conflict of dma_heap_add() 2022-11-22 18:27:56 +05:30
dma-resv.c dma-buf: fix check in dma_resv_add_fence 2023-12-08 08:51:15 +01:00
selftest.c
selftest.h
selftests.h
st-dma-fence-chain.c dma-buf: Fix NULL pointer dereference in sanitycheck() 2024-04-10 16:28:21 +02:00
st-dma-fence-unwrap.c
st-dma-fence.c
st-dma-resv.c
sw_sync.c dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:11:12 +02:00
sync_debug.c
sync_debug.h
sync_file.c dma-buf: add dma_fence_timestamp helper 2023-10-19 23:08:57 +02:00
sync_trace.h
udmabuf.c whack-a-mole: cropped up open-coded file_inode() uses... 2022-10-06 17:22:11 -07:00