Skip to content

Commit be23fb9

Browse files
matanb10jgunthorpe
authored andcommitted
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: 1f7ff9d ('IB/uverbs: Move to new headers and make naming consistent') Signed-off-by: Matan Barak <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 819b602 commit be23fb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/uapi/rdma/ib_user_ioctl_verbs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <linux/types.h>
3838

3939
#ifndef RDMA_UAPI_PTR
40-
#define RDMA_UAPI_PTR(_type, _name) _type __attribute__((aligned(8))) _name
40+
#define RDMA_UAPI_PTR(_type, _name) __aligned_u64 _name
4141
#endif
4242

4343
#endif

0 commit comments

Comments
 (0)