udmabuf: reject unknown UDMABUF_CREATE flags
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest1 patch 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | udmabuf: reject unknown UDMABUF_CREATE flagsdrivers/ include/ tools/ | +29 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/1] udmabuf: reject unknown UDMABUF_CREATE flags
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(-)
Signature · 1 line
2.43.0