]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2015 13:05:53 +0000 (15:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2015 13:05:53 +0000 (15:05 +0200)
added patches:
ib-mlx4-saturate-roce-port-pma-counters-in-case-of-overflow.patch
net-llc-use-correct-size-for-sysctl-timeout-entries.patch
net-rds-use-correct-size-for-max-unacked-packets-and-bytes.patch

queue-3.14/ib-mlx4-saturate-roce-port-pma-counters-in-case-of-overflow.patch [new file with mode: 0644]
queue-3.14/net-llc-use-correct-size-for-sysctl-timeout-entries.patch [new file with mode: 0644]
queue-3.14/net-rds-use-correct-size-for-max-unacked-packets-and-bytes.patch [new file with mode: 0644]
queue-3.14/series

diff --git a/queue-3.14/ib-mlx4-saturate-roce-port-pma-counters-in-case-of-overflow.patch b/queue-3.14/ib-mlx4-saturate-roce-port-pma-counters-in-case-of-overflow.patch
new file mode 100644 (file)
index 0000000..880cc00
--- /dev/null
@@ -0,0 +1,61 @@
+From 61a3855bb726cbb062ef02a31a832dea455456e0 Mon Sep 17 00:00:00 2001
+From: Majd Dibbiny <majd@mellanox.com>
+Date: Wed, 18 Mar 2015 16:51:37 +0200
+Subject: IB/mlx4: Saturate RoCE port PMA counters in case of overflow
+
+From: Majd Dibbiny <majd@mellanox.com>
+
+commit 61a3855bb726cbb062ef02a31a832dea455456e0 upstream.
+
+For RoCE ports, we set the u32 PMA values based on u64 HCA counters. In case of
+overflow, according to the IB spec, we have to saturate a counter to its
+max value, do that.
+
+Fixes: c37791349cc7 ('IB/mlx4: Support PMA counters for IBoE')
+Signed-off-by: Majd Dibbiny <majd@mellanox.com>
+Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
+Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
+Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/infiniband/hw/mlx4/mad.c |   20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+--- a/drivers/infiniband/hw/mlx4/mad.c
++++ b/drivers/infiniband/hw/mlx4/mad.c
+@@ -64,6 +64,14 @@ enum {
+ #define GUID_TBL_BLK_NUM_ENTRIES 8
+ #define GUID_TBL_BLK_SIZE (GUID_TBL_ENTRY_SIZE * GUID_TBL_BLK_NUM_ENTRIES)
++/* Counters should be saturate once they reach their maximum value */
++#define ASSIGN_32BIT_COUNTER(counter, value) do {\
++      if ((value) > U32_MAX)                   \
++              counter = cpu_to_be32(U32_MAX); \
++      else                                     \
++              counter = cpu_to_be32(value);    \
++} while (0)
++
+ struct mlx4_mad_rcv_buf {
+       struct ib_grh grh;
+       u8 payload[256];
+@@ -730,10 +738,14 @@ static int ib_process_mad(struct ib_devi
+ static void edit_counter(struct mlx4_counter *cnt,
+                                       struct ib_pma_portcounters *pma_cnt)
+ {
+-      pma_cnt->port_xmit_data = cpu_to_be32((be64_to_cpu(cnt->tx_bytes)>>2));
+-      pma_cnt->port_rcv_data  = cpu_to_be32((be64_to_cpu(cnt->rx_bytes)>>2));
+-      pma_cnt->port_xmit_packets = cpu_to_be32(be64_to_cpu(cnt->tx_frames));
+-      pma_cnt->port_rcv_packets  = cpu_to_be32(be64_to_cpu(cnt->rx_frames));
++      ASSIGN_32BIT_COUNTER(pma_cnt->port_xmit_data,
++                           (be64_to_cpu(cnt->tx_bytes) >> 2));
++      ASSIGN_32BIT_COUNTER(pma_cnt->port_rcv_data,
++                           (be64_to_cpu(cnt->rx_bytes) >> 2));
++      ASSIGN_32BIT_COUNTER(pma_cnt->port_xmit_packets,
++                           be64_to_cpu(cnt->tx_frames));
++      ASSIGN_32BIT_COUNTER(pma_cnt->port_rcv_packets,
++                           be64_to_cpu(cnt->rx_frames));
+ }
+ static int iboe_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
diff --git a/queue-3.14/net-llc-use-correct-size-for-sysctl-timeout-entries.patch b/queue-3.14/net-llc-use-correct-size-for-sysctl-timeout-entries.patch
new file mode 100644 (file)
index 0000000..80f87fe
--- /dev/null
@@ -0,0 +1,56 @@
+From 6b8d9117ccb4f81b1244aafa7bc70ef8fa45fc49 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sasha.levin@oracle.com>
+Date: Fri, 23 Jan 2015 20:47:00 -0500
+Subject: net: llc: use correct size for sysctl timeout entries
+
+From: Sasha Levin <sasha.levin@oracle.com>
+
+commit 6b8d9117ccb4f81b1244aafa7bc70ef8fa45fc49 upstream.
+
+The timeout entries are sizeof(int) rather than sizeof(long), which
+means that when they were getting read we'd also leak kernel memory
+to userspace along with the timeout values.
+
+Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/llc/sysctl_net_llc.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/net/llc/sysctl_net_llc.c
++++ b/net/llc/sysctl_net_llc.c
+@@ -18,28 +18,28 @@ static struct ctl_table llc2_timeout_tab
+       {
+               .procname       = "ack",
+               .data           = &sysctl_llc2_ack_timeout,
+-              .maxlen         = sizeof(long),
++              .maxlen         = sizeof(sysctl_llc2_ack_timeout),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec_jiffies,
+       },
+       {
+               .procname       = "busy",
+               .data           = &sysctl_llc2_busy_timeout,
+-              .maxlen         = sizeof(long),
++              .maxlen         = sizeof(sysctl_llc2_busy_timeout),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec_jiffies,
+       },
+       {
+               .procname       = "p",
+               .data           = &sysctl_llc2_p_timeout,
+-              .maxlen         = sizeof(long),
++              .maxlen         = sizeof(sysctl_llc2_p_timeout),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec_jiffies,
+       },
+       {
+               .procname       = "rej",
+               .data           = &sysctl_llc2_rej_timeout,
+-              .maxlen         = sizeof(long),
++              .maxlen         = sizeof(sysctl_llc2_rej_timeout),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec_jiffies,
+       },
diff --git a/queue-3.14/net-rds-use-correct-size-for-max-unacked-packets-and-bytes.patch b/queue-3.14/net-rds-use-correct-size-for-max-unacked-packets-and-bytes.patch
new file mode 100644 (file)
index 0000000..626c104
--- /dev/null
@@ -0,0 +1,42 @@
+From db27ebb111e9f69efece08e4cb6a34ff980f8896 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sasha.levin@oracle.com>
+Date: Tue, 3 Feb 2015 08:55:58 -0500
+Subject: net: rds: use correct size for max unacked packets and bytes
+
+From: Sasha Levin <sasha.levin@oracle.com>
+
+commit db27ebb111e9f69efece08e4cb6a34ff980f8896 upstream.
+
+Max unacked packets/bytes is an int while sizeof(long) was used in the
+sysctl table.
+
+This means that when they were getting read we'd also leak kernel memory
+to userspace along with the timeout values.
+
+Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/rds/sysctl.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/rds/sysctl.c
++++ b/net/rds/sysctl.c
+@@ -71,14 +71,14 @@ static struct ctl_table rds_sysctl_rds_t
+       {
+               .procname       = "max_unacked_packets",
+               .data           = &rds_sysctl_max_unacked_packets,
+-              .maxlen         = sizeof(unsigned long),
++              .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec,
+       },
+       {
+               .procname       = "max_unacked_bytes",
+               .data           = &rds_sysctl_max_unacked_bytes,
+-              .maxlen         = sizeof(unsigned long),
++              .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec,
+       },
index 008cca34f1fe5f824695421a492e1ed7d41be7be..f04f156cf0d610821d843134cd2a28a00cf62f4c 100644 (file)
@@ -38,3 +38,6 @@ ioctx_alloc-fix-vma-and-file-leak-on-failure.patch
 iscsi-target-fix-oops-when-adding-reject-pdu.patch
 sh_veu-v4l2_dev-wasn-t-set.patch
 media-s5p-mfc-fix-mmap-support-for-64bit-arch.patch
+net-rds-use-correct-size-for-max-unacked-packets-and-bytes.patch
+net-llc-use-correct-size-for-sysctl-timeout-entries.patch
+ib-mlx4-saturate-roce-port-pma-counters-in-case-of-overflow.patch