From be23fb9a2c1d33037c1499a04e93bb0c03cf73d6 Mon Sep 17 00:00:00 2001 From: Matan Barak Date: Thu, 22 Mar 2018 11:52:02 +0200 Subject: [PATCH] IB/uverbs: UAPI pointers should use __aligned_u64 type 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 Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- include/uapi/rdma/ib_user_ioctl_verbs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/rdma/ib_user_ioctl_verbs.h b/include/uapi/rdma/ib_user_ioctl_verbs.h index 3d3a2f017abc9..173629ecc09b2 100644 --- a/include/uapi/rdma/ib_user_ioctl_verbs.h +++ b/include/uapi/rdma/ib_user_ioctl_verbs.h @@ -37,7 +37,7 @@ #include #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 -- 2.39.5