linux-stable/drivers/dma-buf
Pavel Sakharov 156c226cbb 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:35:40 +02:00
..
heaps
Kconfig
Makefile
dma-buf-sysfs-stats.c
dma-buf-sysfs-stats.h
dma-buf.c
dma-fence-array.c
dma-fence-chain.c
dma-fence-unwrap.c
dma-fence.c
dma-heap.c
dma-resv.c
selftest.c
selftest.h
selftests.h
st-dma-fence-chain.c
st-dma-fence-unwrap.c
st-dma-fence.c
st-dma-resv.c
sw_sync.c
sync_debug.c
sync_debug.h
sync_file.c
sync_trace.h
udmabuf.c