IB/uverbs: UAPI pointers should use __aligned_u64 type
authorMatan Barak <matanb@mellanox.com>
Thu, 22 Mar 2018 09:52:02 +0000 (11:52 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 27 Mar 2018 20:43:10 +0000 (14:43 -0600)
The ioctl() UAPIs are meant to be used by both user-space
and kernel ioctl() handlers.

Mostly, these UAPI structs tend to consist of simple types, but
sometimes user-space pointers may be passed between user-space and
kernel. We would like to avoid dereferencing a user-space pointer in
the kernel, thus - we always define RDMA_UAPI_PTR as a __aligned_u64
type.

Fixes: 1f7ff9d5d36a ('IB/uverbs: Move to new headers and make naming consistent')
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
include/uapi/rdma/ib_user_ioctl_verbs.h

index 3d3a2f017abc9fa4b326d71713274d49963c2fc6..173629ecc09b28852b9da0531eb22f653b646f6d 100644 (file)
@@ -37,7 +37,7 @@
 #include <linux/types.h>
 
 #ifndef RDMA_UAPI_PTR
-#define RDMA_UAPI_PTR(_type, _name)    _type __attribute__((aligned(8))) _name
+#define RDMA_UAPI_PTR(_type, _name)    __aligned_u64 _name
 #endif
 
 #endif