linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/2] net/smc: use __aigned_u64 for 64-bit smc_diag fields
@ 2018-10-06 20:32 Eugene Syromiatnikov
  2018-10-07  8:32 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-06 20:32 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, linux-kernel, Ursula Braun, Karsten Graul, Hans Wippel

Commit v4.19-rc1~140^2~507^2~1 ("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
the 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>
---
 include/uapi/linux/smc_diag.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/uapi/linux/smc_diag.h b/include/uapi/linux/smc_diag.h
index ac9e8c9..6180c6d 100644
--- a/include/uapi/linux/smc_diag.h
+++ b/include/uapi/linux/smc_diag.h
@@ -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 */
@@ -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_ */
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net 1/2] net/smc: use __aigned_u64 for 64-bit smc_diag fields
  2018-10-06 20:32 [PATCH net 1/2] net/smc: use __aigned_u64 for 64-bit smc_diag fields Eugene Syromiatnikov
@ 2018-10-07  8:32 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2018-10-07  8:32 UTC (permalink / raw)
  To: Eugene Syromiatnikov, netdev
  Cc: David S. Miller, linux-kernel, Ursula Braun, Karsten Graul, Hans Wippel

Hello!

On 10/6/2018 11:32 PM, Eugene Syromiatnikov wrote:

> Commit v4.19-rc1~140^2~507^2~1 ("net/smc: add SMC-D diag support")

    You have the SHA1 below in the "Fixes:" tag, need the same 12 digits here.

> 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
> the 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>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-07  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-06 20:32 [PATCH net 1/2] net/smc: use __aigned_u64 for 64-bit smc_diag fields Eugene Syromiatnikov
2018-10-07  8:32 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).