mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 13:43:55 +08:00
958d2c1ba3
What is going on here is a bit subtle, in the kernel there is no problem because the struct is copied using copy_from_user, so it can safely have an 8 byte alignment, however in userspace it must be constructed by concatenation with the ib_uverbs_alloc_pd_resp struct. This is due to the required memory layout to execute the command. Since ibv_uverbs_alloc_pd_resp is only 4 bytes long, this causes misalignment, and the user space will experience an unexpected padding. Currently it works around this via pointer maths. Make everything more robust by having the compiler reduce the alignment of the struct to 4. The userspace has assertions to ensure this works properly in all situations. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> |
||
---|---|---|
.. | ||
hfi | ||
bnxt_re-abi.h | ||
cxgb3-abi.h | ||
cxgb4-abi.h | ||
hns-abi.h | ||
i40iw-abi.h | ||
ib_user_cm.h | ||
ib_user_ioctl_verbs.h | ||
ib_user_mad.h | ||
ib_user_sa.h | ||
ib_user_verbs.h | ||
mlx4-abi.h | ||
mlx5-abi.h | ||
mthca-abi.h | ||
nes-abi.h | ||
ocrdma-abi.h | ||
qedr-abi.h | ||
rdma_netlink.h | ||
rdma_user_cm.h | ||
rdma_user_ioctl.h | ||
rdma_user_rxe.h | ||
vmw_pvrdma-abi.h |