[PATCH 0/1] udmabuf: reject unknown UDMABUF_CREATE flags
From: Iván Ezequiel Rodriguez
Date: Wed Jul 01 2026 - 13:33:00 EST
UDMABUF_CREATE and UDMABUF_CREATE_LIST only define UDMABUF_FLAGS_CLOEXEC
in include/uapi/linux/udmabuf.h. Today the driver masks unknown flag bits
and returns a dmabuf fd anyway, so userspace cannot tell that an
unsupported flag was ignored. dma-heap already rejects unknown fd_flags
and heap_flags with -EINVAL; apply the same policy in udmabuf_create(),
which is shared by both ioctls.
This series adds the driver check, documents the flag semantics in the
uapi header, and extends the existing kselftest with test-unknown-flags
(UDMABUF_FLAGS_CLOEXEC | 0x2 must fail).
Tested with the udmabuf kselftest on a kernel built with this patch
(test-unknown-flags PASS).
Iván Ezequiel Rodriguez (1):
udmabuf: reject unknown UDMABUF_CREATE flags
drivers/dma-buf/udmabuf.c | 3 +++
include/uapi/linux/udmabuf.h | 13 +++++++++++++
tools/testing/selftests/drivers/dma-buf/udmabuf.c | 14 +++++++++++++-
3 files changed, 29 insertions(+), 1 deletion(-)
--
2.43.0