linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Sasha Neftin <sasha.neftin@intel.com>,
	Alexander H Duyck <alexander.h.duyck@intel.com>,
	Dima Ruinskiy <dima.ruinskiy@intel.com>,
	Raanan Avargil <raanan.avargil@intel.com>,
	Aaron Brown <aaron.f.brown@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [PATCH 4.14 87/95] e1000e: fix the use of magic numbers for buffer overrun issue
Date: Mon,  4 Dec 2017 17:00:51 +0100	[thread overview]
Message-ID: <20171204160049.621192616@linuxfoundation.org> (raw)
In-Reply-To: <20171204160046.206920966@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sasha Neftin <sasha.neftin@intel.com>

commit c0f4b163a03e73055dd734eaca64b9580e72e7fb upstream.

This is a follow on to commit b10effb92e27 ("fix buffer overrun while the
 I219 is processing DMA transactions") to address David Laights concerns
about the use of "magic" numbers.  So define masks as well as add
additional code comments to give a better understanding of what needs to
be done to avoid a buffer overrun.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Reviewed-by: Alexander H Duyck <alexander.h.duyck@intel.com>
Reviewed-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Reviewed-by: Raanan Avargil <raanan.avargil@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/ethernet/intel/e1000e/ich8lan.h |    3 ++-
 drivers/net/ethernet/intel/e1000e/netdev.c  |    9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
@@ -113,7 +113,8 @@
 #define NVM_SIZE_MULTIPLIER 4096	/*multiplier for NVMS field */
 #define E1000_FLASH_BASE_ADDR 0xE000	/*offset of NVM access regs */
 #define E1000_CTRL_EXT_NVMVS 0x3	/*NVM valid sector */
-#define E1000_TARC0_CB_MULTIQ_3_REQ	(1 << 28 | 1 << 29)
+#define E1000_TARC0_CB_MULTIQ_3_REQ	0x30000000
+#define E1000_TARC0_CB_MULTIQ_2_REQ	0x20000000
 #define PCIE_ICH8_SNOOP_ALL	PCIE_NO_SNOOP_ALL
 
 #define E1000_ICH_RAR_ENTRIES	7
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3030,9 +3030,12 @@ static void e1000_configure_tx(struct e1
 		ew32(IOSFPC, reg_val);
 
 		reg_val = er32(TARC(0));
-		/* SPT and KBL Si errata workaround to avoid Tx hang */
-		reg_val &= ~BIT(28);
-		reg_val |= BIT(29);
+		/* SPT and KBL Si errata workaround to avoid Tx hang.
+		 * Dropping the number of outstanding requests from
+		 * 3 to 2 in order to avoid a buffer overrun.
+		 */
+		reg_val &= ~E1000_TARC0_CB_MULTIQ_3_REQ;
+		reg_val |= E1000_TARC0_CB_MULTIQ_2_REQ;
 		ew32(TARC(0), reg_val);
 	}
 }

  parent reply	other threads:[~2017-12-04 16:09 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 15:59 [PATCH 4.14 00/95] 4.14.4-stable review Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 02/95] mm, memory_hotplug: do not back off draining pcp free pages from kworker context Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 03/95] mm, oom_reaper: gather each vma to prevent leaking TLB entry Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 04/95] mm, thp: Do not make page table dirty unconditionally in touch_p[mu]d() Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 05/95] mm/cma: fix alloc_contig_range ret code/potential leak Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 06/95] mm: fix device-dax pud write-faults triggered by get_user_pages() Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 07/95] mm, hugetlbfs: introduce ->split() to vm_operations_struct Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 08/95] device-dax: implement ->split() to catch invalid munmap attempts Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 09/95] mm: introduce get_user_pages_longterm Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 10/95] mm: fail get_vaddr_frames() for filesystem-dax mappings Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 11/95] v4l2: disable filesystem-dax mapping support Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 12/95] IB/core: disable memory registration of filesystem-dax vmas Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 13/95] exec: avoid RLIMIT_STACK races with prlimit() Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 14/95] mm/madvise.c: fix madvise() infinite loop under special circumstances Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 16/95] mm, memcg: fix mem_cgroup_swapout() for THPs Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 17/95] fs/fat/inode.c: fix sb_rdonly() change Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 18/95] autofs: revert "autofs: take more care to not update last_used on path walk" Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 19/95] autofs: revert "autofs: fix AT_NO_AUTOMOUNT not being honored" Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 20/95] mm/hugetlb: fix NULL-pointer dereference on 5-level paging machine Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 21/95] btrfs: clear space cache inode generation always Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 22/95] nfsd: Fix stateid races between OPEN and CLOSE Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 23/95] nfsd: Fix another OPEN stateid race Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 24/95] nfsd: fix panic in posix_unblock_lock called from nfs4_laundromat Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 25/95] crypto: algif_aead - skip SGL entries with NULL page Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 26/95] crypto: af_alg - remove locking in async callback Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 28/95] lockd: lost rollback of set_grace_period() in lockd_down_net() Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 29/95] s390: revert ELF_ET_DYN_BASE base changes Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 30/95] drm: omapdrm: Fix DPI on platforms using the DSI VDDS Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 31/95] omapdrm: hdmi4: Correct the SoC revision matching Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 32/95] apparmor: fix oops in audit_signal_cb hook Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 33/95] arm64: module-plts: factor out PLT generation code for ftrace Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 34/95] arm64: ftrace: emit ftrace-mod.o contents through code Greg Kroah-Hartman
2017-12-04 15:59 ` [PATCH 4.14 35/95] powerpc/powernv: Fix kexec crashes caused by tlbie tracing Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 36/95] powerpc/kexec: Fix kexec/kdump in P9 guest kernels Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 40/95] KVM: lapic: Split out x2apic ldr calculation Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 41/95] KVM: lapic: Fixup LDR on load in x2apic Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 42/95] mmc: sdhci: Avoid swiotlb buffer being full Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 43/95] mmc: block: Fix missing blk_put_request() Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 44/95] mmc: block: Check return value of blk_get_request() Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 45/95] mmc: core: Do not leave the block driver in a suspended state Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 46/95] mmc: block: Ensure that debugfs files are removed Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 47/95] mmc: core: prepend 0x to pre_eol_info entry in sysfs Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 48/95] mmc: core: prepend 0x to OCR " Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 49/95] ACPI / EC: Fix regression related to PM ops support in ECDT device Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 50/95] eeprom: at24: fix reading from 24MAC402/24MAC602 Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 51/95] eeprom: at24: correctly set the size for at24mac402 Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 52/95] eeprom: at24: check at24_read/write arguments Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 53/95] i2c: i801: Fix Failed to allocate irq -2147483648 error Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 54/95] cxl: Check if vphb exists before iterating over AFU devices Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 55/95] bcache: Fix building error on MIPS Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 56/95] bcache: only permit to recovery read error when cache device is clean Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 57/95] bcache: recover data from backing when data " Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 58/95] hwmon: (jc42) optionally try to disable the SMBUS timeout Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 59/95] nvme-pci: add quirk for delay before CHK RDY for WDC SN200 Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 63/95] drm/amdgpu: correct reference clock value on vega10 Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 65/95] drm/amdgpu: Properly allocate VM invalidate eng v2 Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 66/95] drm/amdgpu: Remove check which is not valid for certain VBIOS Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 73/95] drm/tilcdc: Precalculate total frametime in tilcdc_crtc_set_mode() Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 74/95] drm/radeon: fix atombios on big endian Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 75/95] drm/panel: simple: Add missing panel_simple_unprepare() calls Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 76/95] drm/hisilicon: Ensure LDI regs are properly configured Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 78/95] drm/amd/pp: fix typecast error in powerplay Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 79/95] drm/fb_helper: Disable all crtcs when initial setup fails Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 80/95] drm/fsl-dcu: Dont set connector DPMS property Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 84/95] include/linux/compiler-clang.h: handle randomizable anonymous structs Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 85/95] IB/core: Do not warn on lid conversions for OPA Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 86/95] IB/hfi1: " Greg Kroah-Hartman
2017-12-04 16:00 ` Greg Kroah-Hartman [this message]
2017-12-04 16:00 ` [PATCH 4.14 88/95] md: forbid a RAID5 from having both a bitmap and a journal Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 89/95] drm/i915: Fix false-positive assert_rpm_wakelock_held in i915_pmic_bus_access_notifier v2 Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 90/95] drm/i915: Re-register PMIC bus access notifier on runtime resume Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 91/95] drm/i915/fbdev: Serialise early hotplug events with async fbdev config Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 92/95] drm/i915/gvt: Correct ADDR_4K/2M/1G_MASK definition Greg Kroah-Hartman
2017-12-04 16:00 ` [PATCH 4.14 95/95] Revert "x86/entry/64: Add missing irqflags tracing to native_load_gs_index()" Greg Kroah-Hartman
2017-12-04 20:29 ` [PATCH 4.14 00/95] 4.14.4-stable review Shuah Khan
2017-12-05  6:25   ` Greg Kroah-Hartman
2017-12-04 21:12 ` Tom Gall
2017-12-05  6:24   ` Greg Kroah-Hartman
2017-12-05 21:45     ` Tom Gall
2017-12-06  6:49       ` Greg Kroah-Hartman
2017-12-06  6:51         ` Greg Kroah-Hartman
2017-12-06 18:01         ` Tom Gall
2017-12-07  7:49           ` Greg Kroah-Hartman
2017-12-06 14:41     ` Sumit Semwal
2017-12-06 15:33       ` Greg Kroah-Hartman
2017-12-06 15:39         ` Sumit Semwal
2017-12-04 23:46 ` Guenter Roeck
2017-12-05  6:24   ` Greg Kroah-Hartman
2017-12-05  7:01 ` Naresh Kamboju
2017-12-05  7:50   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171204160049.621192616@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=aaron.f.brown@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=dima.ruinskiy@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raanan.avargil@intel.com \
    --cc=sasha.neftin@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).