History

dma-buf: Fix SET_NAME ioctl uapi

The uapi is the same on 32 and 64 bit, but the number isn't. Everyone who botched this please re-read: https://www.kernel.org/doc/html/v5.4-preprc-cpu/ioctl/botching-up-ioctls.html Also, the type argument for the ioctl macros is for the type the void __user *arg pointer points at, which in this case would be the variable-sized char[] of a 0 terminated string. So this was botched in more than just the usual ways.

Daniel Vetter committed 6 years ago

Commit a5bff921 parent 6292b8e2 files · +8 −1Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/dma-buf.h+6−0
@@ -39,6 +39,12 @@ struct dma_buf_sync { · 38 unmodified lines
3939
4040 #define DMA_BUF_BASE 'b'
4141 #define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
42+
43+/* 32/64bitness of this uapi was botched in android, there's no difference
44+ * between them in actual uapi, they're just different numbers.
45+ */
4246 #define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
47+#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, u32)
48+#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, u64)
4349
4450 #endif