linux/drivers/dma-buf
Christian König 51db5336e1 dma-buf: improve sg_table debugging hack v4
This debugging hack is important to enforce the rule that importers
should *never* touch the underlying struct page of the exporter.

Instead of just mangling the page link create a copy of the sg_table
but only copy over the DMA addresses and not the pages.

This will cause a NULL pointer de-reference if the importer tries to
touch the struct page. Still quite a hack but this at least allows the
exporter to properly keeps it's sg_table intact while allowing the
DMA-buf maintainer to find and fix misbehaving importers and finally
switch over to using a different data structure in the future.

v2: improve the hack further by using a wrapper structure and explaining
the background a bit more in the commit message.
v3: fix some whitespace issues, use sg_assign_page().
v4: give the functions a better name

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://lore.kernel.org/r/20251205130604.1582-1-christian.koenig@amd.com
2025-12-08 16:39:09 +01:00
..
heaps dma-buf: system_heap: use larger contiguous mappings instead of per-page mmap 2025-11-21 10:48:00 +05:30
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: improve sg_table debugging hack v4 2025-12-08 16:39:09 +01:00
dma-fence-array.c dma-buf: fix dma_fence_array_signaled v4 2024-11-25 20:08:27 +01:00
dma-fence-chain.c dma-fence: Use a flag for 64-bit seqnos 2025-06-03 17:38:04 +01:00
dma-fence-unwrap.c dma-fence: Add helper to sort and deduplicate dma_fence arrays 2025-05-05 13:29:44 -04:00
dma-fence.c dma-buf/dma-fence: Remove return code of signaling-functions 2025-12-04 15:03:40 +01:00
dma-heap.c dma-buf: dma-heap: export declared functions 2025-09-11 11:22:17 +02:00
dma-resv.c dma-buf: fix timeout handling in dma_resv_wait_timeout v2 2025-06-30 13:15:44 +02:00
Kconfig Revert "udmabuf: fix vmap_udmabuf error page set" 2025-05-15 21:54:51 -07:00
Makefile dma-buf: cleanup dma_fence_unwrap implementation 2022-05-30 14:16:32 +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 dma-buf: Fix NULL pointer dereference in sanitycheck() 2024-03-20 10:15:45 +01:00
st-dma-fence-unwrap.c dma-fence: Add some more fence-merge-unwrap tests 2025-01-09 16:40:02 +01:00
st-dma-fence.c dma-buf: Don't misuse dma_fence_signal() 2025-12-04 15:03:40 +01: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: always taint the kernel when sw-sync is used 2025-11-25 10:07:08 +01:00
sync_debug.c dma-buf/sw-sync: Remove unused debug code 2025-05-08 12:51:59 +02:00
sync_debug.h dma-buf/sw-sync: Remove unused debug code 2025-05-08 12:51:59 +02:00
sync_file.c sync_file: Protect access to driver and timeline name 2025-06-13 08:24:12 +01:00
sync_trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
udmabuf.c drm-misc-next for 6.17: 2025-06-18 08:09:35 +10:00