Skip to content

Commit 2dc675f

Browse files
arndbjgunthorpe
authored andcommitted
RDMA/ucma: Fix rdma_ucm_query_ib_service_resp struct padding
On a few 32-bit architectures, the newly added ib_user_service_rec structure is not 64-bit aligned the way it is on most regular ones. Add explicit padding into the rdma_ucm_query_ib_service_resp and rdma_ucm_resolve_ib_service structures that embed it, so that the layout is compatible across all of them. This is an ABI change on i386, aligning it with x86_64 and the other 64-bit architectures to avoid having to use a compat ioctl handler. Fixes: 810f874 ("RDMA/ucma: Support query resolved service records") Link: https://patch.msgid.link/r/20251208133311.313977-1-arnd@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 57f3cb6 commit 2dc675f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

include/uapi/rdma/rdma_user_cm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ struct rdma_ucm_query_path_resp {
192192

193193
struct rdma_ucm_query_ib_service_resp {
194194
__u32 num_service_recs;
195+
__u32 reserved;
195196
struct ib_user_service_rec recs[];
196197
};
197198

@@ -354,14 +355,15 @@ enum {
354355

355356
#define RDMA_USER_CM_IB_SERVICE_NAME_SIZE 64
356357
struct rdma_ucm_ib_service {
357-
__u64 service_id;
358+
__aligned_u64 service_id;
358359
__u8 service_name[RDMA_USER_CM_IB_SERVICE_NAME_SIZE];
359360
__u32 flags;
360361
__u32 reserved;
361362
};
362363

363364
struct rdma_ucm_resolve_ib_service {
364365
__u32 id;
366+
__u32 reserved;
365367
struct rdma_ucm_ib_service ibs;
366368
};
367369

0 commit comments

Comments
 (0)