Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-10-15 10:16:55 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-10-15 10:17:05 +0200
commit180fec1d5fb0787bd498232990d489746550da2f (patch)
tree17205f7aeda9af8d5635ac7e449b84c00efaece8
parentf261938ae38ecdbdcaeb03e7866202ae85e5431d (diff)
net/smc: use __aligned_u64 for 64-bit smc_diag fields
(FATE#325041, bsc#1101138, LTC#164002).
-rw-r--r--patches.drivers/net-smc-use-__aligned_u64-for-64-bit-smc_diag-fields.patch61
-rw-r--r--series.conf1
2 files changed, 62 insertions, 0 deletions
diff --git a/patches.drivers/net-smc-use-__aligned_u64-for-64-bit-smc_diag-fields.patch b/patches.drivers/net-smc-use-__aligned_u64-for-64-bit-smc_diag-fields.patch
new file mode 100644
index 0000000000..7cbb898ae8
--- /dev/null
+++ b/patches.drivers/net-smc-use-__aligned_u64-for-64-bit-smc_diag-fields.patch
@@ -0,0 +1,61 @@
+From: Eugene Syromiatnikov <esyr@redhat.com>
+Date: Sun, 7 Oct 2018 16:57:31 +0200
+Subject: net/smc: use __aligned_u64 for 64-bit smc_diag fields
+Patch-mainline: v4.19-rc8
+Git-commit: a21048c8ec7caf4def353b00b75bf75535deba80
+References: FATE#325041, bsc#1101138, LTC#164002
+
+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>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ include/uapi/linux/smc_diag.h | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+--- a/include/uapi/linux/smc_diag.h
++++ b/include/uapi/linux/smc_diag.h
+@@ -17,14 +17,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 */
+@@ -98,11 +98,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_ */
diff --git a/series.conf b/series.conf
index 3f40eaaaf4..cc0a1bc18c 100644
--- a/series.conf
+++ b/series.conf
@@ -18015,6 +18015,7 @@
patches.arch/powerpc-numa-Skip-onlining-a-offline-node-in-kdump-p.patch
patches.drivers/scsi-qedi-initialize-the-stats-mutex-lock
patches.drivers/usb-cdc_acm-Do-not-leak-URB-buffers.patch
+ patches.drivers/net-smc-use-__aligned_u64-for-64-bit-smc_diag-fields.patch
# davem/net
patches.fixes/udp-Unbreak-modules-that-rely-on-external-__skb_recv.patch