History

net/smc: use __aligned_u64 for 64-bit smc_diag fields

Commit 4b1b7d3b30a6 ("net/smc: add SMC-D diag support") introduced new UAPI-exposed structure, struct smcd_diag_dmbinfo. However, it's not usable by compat binaries, as it has different layout there. Probably, the most straightforward fix that will avoid similar issues in the future is to use __aligned_u64 for 64-bit fields.

Eugene Syromiatnikov committed 8 years ago

Commit a21048c1 parent 6d4c4071 file · +11 −11Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/smc_diag.h+11−11
@@ -18,14 +18,14 @@ struct smc_diag_req { · 17 unmodified lines
1818 * on the internal clcsock, and more SMC-related socket data
1919 */
2020 struct smc_diag_msg {
21− __u8 diag_family;
22− __u8 diag_state;
23− __u8 diag_mode;
24− __u8 diag_shutdown;
21+ __u8 diag_family;
22+ __u8 diag_state;
23+ __u8 diag_mode;
24+ __u8 diag_shutdown;
2525 struct inet_diag_sockid id;
2626
27− __u32 diag_uid;
28− __u64 diag_inode;
27+ __u32 diag_uid;
28+ __aligned_u64 diag_inode;
2929 };
3030
3131 /* Mode of a connection */
@@ -99,11 +99,11 @@ struct smc_diag_fallback { · 67 unmodified lines
9999 };
100100
101101 struct smcd_diag_dmbinfo { /* SMC-D Socket internals */
102− __u32 linkid; /* Link identifier */
103− __u64 peer_gid; /* Peer GID */
104− __u64 my_gid; /* My GID */
105− __u64 token; /* Token of DMB */
106− __u64 peer_token; /* Token of remote DMBE */
102+ __u32 linkid; /* Link identifier */
103+ __aligned_u64 peer_gid; /* Peer GID */
104+ __aligned_u64 my_gid; /* My GID */
105+ __aligned_u64 token; /* Token of DMB */
106+ __aligned_u64 peer_token; /* Token of remote DMBE */
107107 };
108108
109109 #endif /* _UAPI_SMC_DIAG_H_ */