diff options
author | Eugene Syromiatnikov <esyr@redhat.com> | 2018-10-07 10:57:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-08 00:06:28 -0400 |
commit | a21048c8ec7caf4def353b00b75bf75535deba80 (patch) | |
tree | 3abe4d2d2008c8fe8fade2a0209900f1121351d8 | |
parent | 6d4c407744dd0338da5d5d76f40dce5adabfb30a (diff) |
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.
Fixes: 4b1b7d3b30a6 ("net/smc: add SMC-D diag support")
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/uapi/linux/smc_diag.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/uapi/linux/smc_diag.h b/include/uapi/linux/smc_diag.h index ac9e8c96d9bd..6180c6d95309 100644 --- a/include/uapi/linux/smc_diag.h +++ b/include/uapi/linux/smc_diag.h | |||
@@ -18,14 +18,14 @@ struct smc_diag_req { | |||
18 | * on the internal clcsock, and more SMC-related socket data | 18 | * on the internal clcsock, and more SMC-related socket data |
19 | */ | 19 | */ |
20 | struct smc_diag_msg { | 20 | struct smc_diag_msg { |
21 | __u8 diag_family; | 21 | __u8 diag_family; |
22 | __u8 diag_state; | 22 | __u8 diag_state; |
23 | __u8 diag_mode; | 23 | __u8 diag_mode; |
24 | __u8 diag_shutdown; | 24 | __u8 diag_shutdown; |
25 | struct inet_diag_sockid id; | 25 | struct inet_diag_sockid id; |
26 | 26 | ||
27 | __u32 diag_uid; | 27 | __u32 diag_uid; |
28 | __u64 diag_inode; | 28 | __aligned_u64 diag_inode; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | /* Mode of a connection */ | 31 | /* Mode of a connection */ |
@@ -99,11 +99,11 @@ struct smc_diag_fallback { | |||
99 | }; | 99 | }; |
100 | 100 | ||
101 | struct smcd_diag_dmbinfo { /* SMC-D Socket internals */ | 101 | struct smcd_diag_dmbinfo { /* SMC-D Socket internals */ |
102 | __u32 linkid; /* Link identifier */ | 102 | __u32 linkid; /* Link identifier */ |
103 | __u64 peer_gid; /* Peer GID */ | 103 | __aligned_u64 peer_gid; /* Peer GID */ |
104 | __u64 my_gid; /* My GID */ | 104 | __aligned_u64 my_gid; /* My GID */ |
105 | __u64 token; /* Token of DMB */ | 105 | __aligned_u64 token; /* Token of DMB */ |
106 | __u64 peer_token; /* Token of remote DMBE */ | 106 | __aligned_u64 peer_token; /* Token of remote DMBE */ |
107 | }; | 107 | }; |
108 | 108 | ||
109 | #endif /* _UAPI_SMC_DIAG_H_ */ | 109 | #endif /* _UAPI_SMC_DIAG_H_ */ |