Skip to contentSkip to conversation

RDMA/ucma: fix rdma_ucm_query_ib_service_resp struct padding

PATCH Applied Arnd Bergmann 2 participants 2 messages Dec 8, 2025 – Dec 17, 2025 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/ucma: fix rdma_ucm_query_ib_service_resp struct padding

From: Arnd Bergmann <[email protected]>

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")
---
 include/uapi/rdma/rdma_user_cm.h | 2 ++
 1 file changed, 2 insertions(+)
include/uapi/rdma/rdma_user_cm.h +2 -0
index 5ded174687ee..8e1d584f6633 100644
@@ -192,6 +192,7 @@ struct rdma_ucm_query_path_resp {
 
 struct rdma_ucm_query_ib_service_resp {
 	__u32 num_service_recs;
+	__u32 :32;
 	struct ib_user_service_rec recs[];
 };
 
@@ -362,6 +363,7 @@ struct rdma_ucm_ib_service {
 
 struct rdma_ucm_resolve_ib_service {
 	__u32 id;
+	__u32 :32;
 	struct rdma_ucm_ib_service ibs;
 };
 
Signature · 1 line
2.39.5
maintainer Applied
#1 lore raw

include/uapi/rdma/rdma_user_cm.h struct rdma_ucm_query_path_resp { · line 197

Quoted 11 lines · Arnd Bergmann
include/uapi/rdma/rdma_user_cm.h +1 -0
index 5ded174687ee..8e1d584f6633 100644
@@ -192,6 +192,7 @@ struct rdma_ucm_query_path_resp {
 
 struct rdma_ucm_query_ib_service_resp {
 	__u32 num_service_recs;
+	__u32 :32;
 	struct ib_user_service_rec recs[];
 };

RDMA doesn't use bitfields here, I changed these to be reserved like the others.

include/uapi/rdma/rdma_user_cm.h struct rdma_ucm_ib_service { · line 368

Quoted 7 lines
include/uapi/rdma/rdma_user_cm.h +1 -0
@@ -362,6 +363,7 @@ struct rdma_ucm_ib_service {
 
 struct rdma_ucm_resolve_ib_service {
 	__u32 id;
+	__u32 :32;
 	struct rdma_ucm_ib_service ibs;
 };

And I added the missing

struct rdma_ucm_ib_service {
- __u64 service_id;
+ __aligned_u64 service_id;

Again, like the others.

Applied to for-rc thanks

Jason