diff options
| author | Baineng Shou <shoubaineng@gmail.com> | 2026-08-17 13:04:57 +0800 |
|---|---|---|
| committer | Christian König <christian.koenig@amd.com> | 2026-08-24 14:21:55 +0200 |
| commit | 8985cbc927fd3e23dfebaa099ae0b6d2b38d3258 (patch) | |
| tree | 958040058630add0486415beab846bffa10094d0 /tools/lib/python/kdoc/python_version.py | |
| parent | 3e164bf592bbbdde269c5cadc60a96f69cc6eed7 (diff) | |
selftests: dmabuf-heaps: add fd-leak-on-EFAULT regression test
Add a test case that verifies no file descriptor is leaked when
DMA_HEAP_IOCTL_ALLOC succeeds internally but copy_to_user() fails
to deliver the fd number back to userspace.
The failure is triggered by placing the ioctl argument in a private
anonymous page and flipping it to PROT_READ (via mprotect) between
the kernel's copy_from_user() and copy_to_user() calls. With the
buggy kernel the ioctl returns -EFAULT but leaves an extra open fd
in the process's fd table; with the fixed kernel the fd count is
unchanged.
This serves as a regression test for:
"dma-buf: dma-heap: don't publish fd before copy_to_user() succeeds"
Suggested-by: Sumit Semwal <sumit.semwal@linaro.org>
Reviewed-by: T.J. Mercier <tjmercier@google.com>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Baineng Shou <shoubaineng@gmail.com>
Link: https://lore.kernel.org/r/20260817050457.1005285-5-shoubaineng@gmail.com
Signed-off-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
