linux-stable/drivers/dma-buf
Pavel Sakharov eabf131cba 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:37:54 +02:00
..
heaps dma-buf: heaps: Don't track CMA dma-buf pages under RssFile 2024-01-31 19:54:58 +05:30
Kconfig
Makefile
dma-buf-sysfs-stats.c dma-buf: Fix the typo in DMA-BUF statistics doc 2023-07-27 09:43:33 +02:00
dma-buf-sysfs-stats.h dma-buf: fix dma_buf_export init order v2 2022-12-13 08:31:45 +01:00
dma-buf.c dma-buf: Replace strlcpy() with strscpy() 2023-11-20 17:39:19 +01:00
dma-fence-array.c dma-buf/fence-array: Add fence deadline support 2023-03-25 10:55:07 -07:00
dma-fence-chain.c dma-buf/fence-chain: Add fence deadline support 2023-03-28 13:38:52 -07:00
dma-fence-unwrap.c dma-buf: add dma_fence_timestamp helper 2023-10-05 11:05:58 +02:00
dma-fence.c dma-buf/sync_file: Add SET_DEADLINE ioctl 2023-12-02 01:17:48 +02:00
dma-heap.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
dma-resv.c dma-buf: fix check in dma_resv_add_fence 2023-11-27 20:00:47 +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:37:54 +02:00
st-dma-fence-unwrap.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
st-dma-fence.c kthread: add kthread_stop_put 2023-10-04 10:41:57 -07:00
st-dma-resv.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
sw_sync.c dma-buf/sw_sync: Add fence deadline support 2023-12-02 01:18:46 +02:00
sync_debug.c
sync_debug.h dma-buf/sw_sync: Add fence deadline support 2023-12-02 01:18:46 +02:00
sync_file.c dma-buf/sync_file: Add SET_DEADLINE ioctl 2023-12-02 01:17:48 +02:00
sync_trace.h
udmabuf.c drm-misc-next for v6.6: 2023-07-17 15:37:57 +02:00