]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.18.85/igbvf-use-smp_rmb-rather-than-read_barrier_depends.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.18.85 / igbvf-use-smp_rmb-rather-than-read_barrier_depends.patch
CommitLineData
f71f4658
GKH
1From 1e1f9ca546556e508d021545861f6b5fc75a95fe Mon Sep 17 00:00:00 2001
2From: Brian King <brking@linux.vnet.ibm.com>
3Date: Fri, 17 Nov 2017 11:05:46 -0600
4Subject: igbvf: Use smp_rmb rather than read_barrier_depends
5
6From: Brian King <brking@linux.vnet.ibm.com>
7
8commit 1e1f9ca546556e508d021545861f6b5fc75a95fe upstream.
9
10The original issue being fixed in this patch was seen with the ixgbe
11driver, but the same issue exists with igbvf as well, as the code is
12very similar. read_barrier_depends is not sufficient to ensure
13loads following it are not speculatively loaded out of order
14by the CPU, which can result in stale data being loaded, causing
15potential system crashes.
16
17Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
18Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
19Tested-by: Aaron Brown <aaron.f.brown@intel.com>
20Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23---
24 drivers/net/ethernet/intel/igbvf/netdev.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27--- a/drivers/net/ethernet/intel/igbvf/netdev.c
28+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
29@@ -808,7 +808,7 @@ static bool igbvf_clean_tx_irq(struct ig
30 break;
31
32 /* prevent any other reads prior to eop_desc */
33- read_barrier_depends();
34+ smp_rmb();
35
36 /* if DD is not set pending work has not been completed */
37 if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)))