Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-buf/sw-sync: always taint the kernel when sw-sync is used

The SW-sync functionality should only be used for testing and debugging
since it is inherently unsave.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://lore.kernel.org/r/20251120150018.27385-3-christian.koenig@amd.com

authored by

Christian König and committed by
Christian König
17331d0f 0a8bc1d0

+4
+4
drivers/dma-buf/sw_sync.c
··· 8 8 #include <linux/file.h> 9 9 #include <linux/fs.h> 10 10 #include <linux/uaccess.h> 11 + #include <linux/panic.h> 11 12 #include <linux/slab.h> 12 13 #include <linux/sync_file.h> 13 14 ··· 349 348 struct sync_pt *pt; 350 349 struct sync_file *sync_file; 351 350 struct sw_sync_create_fence_data data; 351 + 352 + /* SW sync fence are inherently unsafe and can deadlock the kernel */ 353 + add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK); 352 354 353 355 if (fd < 0) 354 356 return fd;