The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/1] udmabuf: reject unknown UDMABUF_CREATE flags
@ 2026-07-01 17:21 Iván Ezequiel Rodriguez
  2026-07-01 17:21 ` [PATCH 1/1] " Iván Ezequiel Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Iván Ezequiel Rodriguez @ 2026-07-01 17:21 UTC (permalink / raw)
  To: kraxel, vivek.kasireddy
  Cc: dri-devel, linux-kselftest, linux-kernel,
	Iván Ezequiel Rodriguez

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-01 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 17:21 [PATCH 0/1] udmabuf: reject unknown UDMABUF_CREATE flags Iván Ezequiel Rodriguez
2026-07-01 17:21 ` [PATCH 1/1] " Iván Ezequiel Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox