Skip to contentSkip to conversation

userfaultfd: uapi: fix UFFDIO_CONTINUE ioctl request definition

PATCH New Gleb Fotengauer-Malinovskiy 1 participant 1 message Jun 25, 2021 userfaultfd

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 userfaultfd: uapi: fix UFFDIO_CONTINUE ioctl request definition

This ioctl request reads from uffdio_continue structure written by userspace which justifies _IOC_WRITE flag. It also writes back to that structure which justifies _IOC_READ flag.

See NOTEs in include/uapi/asm-generic/ioctl.h for more information.

Fixes f619147104c8 ("userfaultfd: add UFFDIO_CONTINUE ioctl")
---
 include/uapi/linux/userfaultfd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Please make sure this patch is merged before v5.13 is released, otherwise the UAPI bug would have to stay for backwards ABI compatibility.

include/uapi/linux/userfaultfd.h +2 -2
index bafbeb1a2624..650480f41f1d 100644
@@ -80,8 +80,8 @@
 				      struct uffdio_zeropage)
 #define UFFDIO_WRITEPROTECT	_IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \
 				      struct uffdio_writeprotect)
-#define UFFDIO_CONTINUE		_IOR(UFFDIO, _UFFDIO_CONTINUE,	\
-				     struct uffdio_continue)
+#define UFFDIO_CONTINUE		_IOWR(UFFDIO, _UFFDIO_CONTINUE,	\
+				      struct uffdio_continue)
 
 /* read() structure */
 struct uffd_msg {
Signature · 1 line
glebfm