提交 be23fb9a 编写于 作者: M Matan Barak 提交者: Jason Gunthorpe

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: 1f7ff9d5 ('IB/uverbs: Move to new headers and make naming consistent')
Signed-off-by: NMatan Barak <matanb@mellanox.com>
Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 819b6028
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册