Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 810f874eda8e ("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>

authored by

Arnd Bergmann and committed by
Jason Gunthorpe
2dc675f6 57f3cb6c

+3 -1
+3 -1
include/uapi/rdma/rdma_user_cm.h
··· 192 192 193 193 struct rdma_ucm_query_ib_service_resp { 194 194 __u32 num_service_recs; 195 + __u32 reserved; 195 196 struct ib_user_service_rec recs[]; 196 197 }; 197 198 ··· 355 354 356 355 #define RDMA_USER_CM_IB_SERVICE_NAME_SIZE 64 357 356 struct rdma_ucm_ib_service { 358 - __u64 service_id; 357 + __aligned_u64 service_id; 359 358 __u8 service_name[RDMA_USER_CM_IB_SERVICE_NAME_SIZE]; 360 359 __u32 flags; 361 360 __u32 reserved; ··· 363 362 364 363 struct rdma_ucm_resolve_ib_service { 365 364 __u32 id; 365 + __u32 reserved; 366 366 struct rdma_ucm_ib_service ibs; 367 367 }; 368 368