Skip to content

Commit

Permalink
net/smc: use __aligned_u64 for 64-bit smc_diag fields
Browse files Browse the repository at this point in the history
Commit 4b1b7d3 ("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: 4b1b7d3 ("net/smc: add SMC-D diag support")
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eugene Syromiatnikov authored and David S. Miller committed Oct 8, 2018
1 parent 6d4c407 commit a21048c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions include/uapi/linux/smc_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ struct smc_diag_req {
* on the internal clcsock, and more SMC-related socket data
*/
struct smc_diag_msg {
__u8 diag_family;
__u8 diag_state;
__u8 diag_mode;
__u8 diag_shutdown;
__u8 diag_family;
__u8 diag_state;
__u8 diag_mode;
__u8 diag_shutdown;
struct inet_diag_sockid id;

__u32 diag_uid;
__u64 diag_inode;
__u32 diag_uid;
__aligned_u64 diag_inode;
};

/* Mode of a connection */
Expand Down Expand Up @@ -99,11 +99,11 @@ struct smc_diag_fallback {
};

struct smcd_diag_dmbinfo { /* SMC-D Socket internals */
__u32 linkid; /* Link identifier */
__u64 peer_gid; /* Peer GID */
__u64 my_gid; /* My GID */
__u64 token; /* Token of DMB */
__u64 peer_token; /* Token of remote DMBE */
__u32 linkid; /* Link identifier */
__aligned_u64 peer_gid; /* Peer GID */
__aligned_u64 my_gid; /* My GID */
__aligned_u64 token; /* Token of DMB */
__aligned_u64 peer_token; /* Token of remote DMBE */
};

#endif /* _UAPI_SMC_DIAG_H_ */

0 comments on commit a21048c

Please sign in to comment.