RDMA/ucma: Fix uABI structure layouts for 32/64 compat

The rdma_ucm_event_resp is a different length on 32 and 64 bit compiles.

The kernel requires it to be the expected length or longer so 32 bit
builds running on a 64 bit kernel will not work.

Retain full compat by having all kernels accept a struct with or without
the trailing reserved field.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Jason Gunthorpe
2018-03-20 14:19:47 -06:00
parent 38b48808b9
commit 611cb92b08
2 changed files with 12 additions and 2 deletions

View File

@@ -270,10 +270,15 @@ struct rdma_ucm_event_resp {
__u32 id;
__u32 event;
__u32 status;
/*
* NOTE: This union is not aligned to 8 bytes so none of the union
* members may contain a u64 or anything with higher alignment than 4.
*/
union {
struct rdma_ucm_conn_param conn;
struct rdma_ucm_ud_param ud;
} param;
__u32 reserved;
};
/* Option levels */