This is a note to let you know that I've just added the patch titled
e1000e: fix the use of magic numbers for buffer overrun issue
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
e1000e-fix-the-use-of-magic-numbers-for-buffer-overrun-issue.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From c0f4b163a03e73055dd734eaca64b9580e72e7fb Mon Sep 17 00:00:00 2001
From: Sasha Neftin <sasha.neftin(a)intel.com>
Date: Mon, 6 Nov 2017 08:31:59 +0200
Subject: e1000e: fix the use of magic numbers for buffer overrun issue
From: Sasha Neftin <sasha.neftin(a)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(a)intel.com>
Reviewed-by: Alexander H Duyck <alexander.h.duyck(a)intel.com>
Reviewed-by: Dima Ruinskiy <dima.ruinskiy(a)intel.com>
Reviewed-by: Raanan Avargil <raanan.avargil(a)intel.com>
Tested-by: Aaron Brown <aaron.f.brown(a)intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher(a)intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)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);
}
}
Patches currently in stable-queue which might be from sasha.neftin(a)intel.com are
queue-4.14/e1000e-fix-the-use-of-magic-numbers-for-buffer-overrun-issue.patch
This is a note to let you know that I've just added the patch titled
NFS: revalidate "." etc correctly on "open".
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
nfs-revalidate-.-etc-correctly-on-open.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From b688741cb06695312f18b730653d6611e1bad28d Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb(a)suse.com>
Date: Fri, 25 Aug 2017 17:34:41 +1000
Subject: NFS: revalidate "." etc correctly on "open".
From: NeilBrown <neilb(a)suse.com>
commit b688741cb06695312f18b730653d6611e1bad28d upstream.
For correct close-to-open semantics, NFS must validate
the change attribute of a directory (or file) on open.
Since commit ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a
d_weak_revalidate dentry op"), open() of "." or a path ending ".." is
not revalidated reliably (except when that direct is a mount point).
Prior to that commit, "." was revalidated using nfs_lookup_revalidate()
which checks the LOOKUP_OPEN flag and forces revalidation if the flag is
set.
Since that commit, nfs_weak_revalidate() is used for NFSv3 (which
ignores the flags) and nothing is used for NFSv4.
This is fixed by using nfs_lookup_verify_inode() in
nfs_weak_revalidate(). This does the revalidation exactly when needed.
Also, add a definition of .d_weak_revalidate for NFSv4.
The incorrect behavior is easily demonstrated by running "echo *" in
some non-mountpoint NFS directory while watching network traffic.
Without this patch, "echo *" sometimes doesn't produce any traffic.
With the patch it always does.
Fixes: ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op")
cc: stable(a)vger.kernel.org (3.9+)
Signed-off-by: NeilBrown <neilb(a)suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker(a)Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
fs/nfs/dir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1266,7 +1266,7 @@ static int nfs_weak_revalidate(struct de
return 0;
}
- error = nfs_revalidate_inode(NFS_SERVER(inode), inode);
+ error = nfs_lookup_verify_inode(inode, flags);
dfprintk(LOOKUPCACHE, "NFS: %s: inode %lu is %s\n",
__func__, inode->i_ino, error ? "invalid" : "valid");
return !error;
@@ -1426,6 +1426,7 @@ static int nfs4_lookup_revalidate(struct
const struct dentry_operations nfs4_dentry_operations = {
.d_revalidate = nfs4_lookup_revalidate,
+ .d_weak_revalidate = nfs_weak_revalidate,
.d_delete = nfs_dentry_delete,
.d_iput = nfs_dentry_iput,
.d_automount = nfs_d_automount,
Patches currently in stable-queue which might be from neilb(a)suse.com are
queue-3.18/nfs-revalidate-.-etc-correctly-on-open.patch
This is a note to let you know that I've just added the patch titled
drm/panel: simple: Add missing panel_simple_unprepare() calls
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
drm-panel-simple-add-missing-panel_simple_unprepare-calls.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From f3621a8eb59a913612c8e6e37d81f16b649f8b6c Mon Sep 17 00:00:00 2001
From: Jonathan Liu <net147(a)gmail.com>
Date: Mon, 7 Aug 2017 21:55:45 +1000
Subject: drm/panel: simple: Add missing panel_simple_unprepare() calls
From: Jonathan Liu <net147(a)gmail.com>
commit f3621a8eb59a913612c8e6e37d81f16b649f8b6c upstream.
During panel removal or system shutdown panel_simple_disable() is called
which disables the panel backlight but the panel is still powered due to
missing calls to panel_simple_unprepare().
Fixes: d02fd93e2cd8 ("drm/panel: simple - Disable panel on shutdown")
Signed-off-by: Jonathan Liu <net147(a)gmail.com>
Signed-off-by: Thierry Reding <treding(a)nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170807115545.27747-1-net147…
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/gpu/drm/panel/panel-simple.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -312,6 +312,7 @@ static int panel_simple_remove(struct de
drm_panel_remove(&panel->base);
panel_simple_disable(&panel->base);
+ panel_simple_unprepare(&panel->base);
if (panel->ddc)
put_device(&panel->ddc->dev);
@@ -327,6 +328,7 @@ static void panel_simple_shutdown(struct
struct panel_simple *panel = dev_get_drvdata(dev);
panel_simple_disable(&panel->base);
+ panel_simple_unprepare(&panel->base);
}
static const struct drm_display_mode auo_b101aw03_mode = {
Patches currently in stable-queue which might be from net147(a)gmail.com are
queue-3.18/drm-panel-simple-add-missing-panel_simple_unprepare-calls.patch
On Wed, Nov 29, 2017 at 01:06:35PM +1100, NeilBrown wrote:
>
> Subject: [PATCH] NFS: revalidate "." etc correctly on "open".
>
> commit b688741cb06695312f18b730653d6611e1bad28d upstream.
>
> For correct close-to-open semantics, NFS must validate
> the change attribute of a directory (or file) on open.
>
> Since commit ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a
> d_weak_revalidate dentry op"), open() of "." or a path ending ".." is
> not revalidated reliably (except when that direct is a mount point).
>
> Prior to that commit, "." was revalidated using nfs_lookup_revalidate()
> which checks the LOOKUP_OPEN flag and forces revalidation if the flag is
> set.
> Since that commit, nfs_weak_revalidate() is used for NFSv3 (which
> ignores the flags) and nothing is used for NFSv4.
>
> This is fixed by using nfs_lookup_verify_inode() in
> nfs_weak_revalidate(). This does the revalidation exactly when needed.
> Also, add a definition of .d_weak_revalidate for NFSv4.
>
> The incorrect behavior is easily demonstrated by running "echo *" in
> some non-mountpoint NFS directory while watching network traffic.
> Without this patch, "echo *" sometimes doesn't produce any traffic.
> With the patch it always does.
>
> Fixes: ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op")
> cc: stable(a)vger.kernel.org (3.9+)
> Signed-off-by: NeilBrown <neilb(a)suse.com>
> Signed-off-by: Anna Schumaker <Anna.Schumaker(a)Netapp.com>
> ---
> fs/nfs/dir.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> This version applies to 3.18.y 4.4.y and 4.9.y
Thanks for the backport, now applied.
greg k-h
On Wed, Nov 29, 2017 at 01:00:25PM +1100, NeilBrown wrote:
>
> Subject: [PATCH] md: forbid a RAID5 from having both a bitmap and a journal.
>
> commit 230b55fa8d64007339319539f8f8e68114d08529 upstream.
>
> Having both a bitmap and a journal is pointless.
> Attempting to do so can corrupt the bitmap if the journal
> replay happens before the bitmap is initialized.
> Rather than try to avoid this corruption, simply
> refuse to allow arrays with both a bitmap and a journal.
> So:
> - if raid5_run sees both are present, fail.
> - if adding a bitmap finds a journal is present, fail
> - if adding a journal finds a bitmap is present, fail.
>
> Cc: stable(a)vger.kernel.org (4.10+)
> Signed-off-by: NeilBrown <neilb(a)suse.com>
> Tested-by: Joshua Kinard <kumba(a)gentoo.org>
> Acked-by: Joshua Kinard <kumba(a)gentoo.org>
> Signed-off-by: Shaohua Li <shli(a)fb.com>
> ---
> drivers/md/bitmap.c | 6 ++++++
> drivers/md/md.c | 2 +-
> drivers/md/raid5.c | 7 +++++++
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
> This commit only had problems due to a filename change.
Oops, I should have caught that one, sorry about that. Thanks for the
patch.
greg k-h
On Tue, Nov 28, 2017 at 11:23:23AM -0800, Jeff Kirsher wrote:
> On Tue, 2017-11-28 at 11:18 +0100, Greg KH wrote:
> > On Tue, Nov 28, 2017 at 11:56:41AM +0200, Neftin, Sasha wrote:
> > > On 28/11/2017 11:27, gregkh(a)linuxfoundation.org wrote:
> > > > This is a note to let you know that I've just added the patch titled
> > > >
> > > > e1000e: fix buffer overrun while the I219 is processing DMA
> > > > transactions
> > > >
> > > > to the 4.14-stable tree which can be found at:
> > > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queu
> > > > e.git;a=summary
> > > >
> > > > The filename of the patch is:
> > > > e1000e-fix-buffer-overrun-while-the-i219-is-processing-dma-
> > > > transactions.patch
> > > > and it can be found in the queue-4.14 subdirectory.
> > > >
> > > > If you, or anyone else, feels it should not be added to the stable
> > > > tree,
> > > > please let <stable(a)vger.kernel.org> know about it.
> > > >
> > > >
> > > > From b10effb92e272051dd1ec0d7be56bf9ca85ab927 Mon Sep 17 00:00:00
> > > > 2001
> > > > From: Sasha Neftin <sasha.neftin(a)intel.com>
> > > > Date: Sun, 6 Aug 2017 16:49:18 +0300
> > > > Subject: e1000e: fix buffer overrun while the I219 is processing DMA
> > > > transactions
> > > > MIME-Version: 1.0
> > > > Content-Type: text/plain; charset=UTF-8
> > > > Content-Transfer-Encoding: 8bit
> > > >
> > > > From: Sasha Neftin <sasha.neftin(a)intel.com>
> > > >
> > > > commit b10effb92e272051dd1ec0d7be56bf9ca85ab927 upstream.
> > > >
> > > > Intel® 100/200 Series Chipset platforms reduced the round-trip
> > > > latency for the LAN Controller DMA accesses, causing in some high
> > > > performance cases a buffer overrun while the I219 LAN Connected
> > > > Device is processing the DMA transactions. I219LM and I219V devices
> > > > can fall into unrecovered Tx hang under very stressfully UDP traffic
> > > > and multiple reconnection of Ethernet cable. This Tx hang of the LAN
> > > > Controller is only recovered if the system is rebooted. Slightly slow
> > > > down DMA access by reducing the number of outstanding requests.
> > > > This workaround could have an impact on TCP traffic performance
> > > > on the platform. Disabling TSO eliminates performance loss for TCP
> > > > traffic without a noticeable impact on CPU performance.
> > > >
> > > > Please, refer to I218/I219 specification update:
> > > > https://www.intel.com/content/www/us/en/embedded/products/networking/
> > > > ethernet-connection-i218-family-documentation.html
> > > >
> > > > Signed-off-by: Sasha Neftin <sasha.neftin(a)intel.com>
> > > > Reviewed-by: Dima Ruinskiy <dima.ruinskiy(a)intel.com>
> > > > Reviewed-by: Raanan Avargil <raanan.avargil(a)intel.com>
> > > > Tested-by: Aaron Brown <aaron.f.brown(a)intel.com>
> > > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher(a)intel.com>
> > > > Signed-off-by: Amit Pundir <amit.pundir(a)linaro.org>
> > > > Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
> > > >
> > > > ---
> > > > drivers/net/ethernet/intel/e1000e/netdev.c | 8 +++++---
> > > > 1 file changed, 5 insertions(+), 3 deletions(-)
> > > >
> > > > --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> > > > +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> > > > @@ -3021,8 +3021,8 @@ static void e1000_configure_tx(struct e1
> > > > hw->mac.ops.config_collision_dist(hw);
> > > > - /* SPT and CNP Si errata workaround to avoid data corruption
> > > > */
> > > > - if (hw->mac.type >= e1000_pch_spt) {
> > > > + /* SPT and KBL Si errata workaround to avoid data corruption
> > > > */
> > > > + if (hw->mac.type == e1000_pch_spt) {
> > > > u32 reg_val;
> > > > reg_val = er32(IOSFPC);
> > > > @@ -3030,7 +3030,9 @@ static void e1000_configure_tx(struct e1
> > > > ew32(IOSFPC, reg_val);
> > > > reg_val = er32(TARC(0));
> > > > - reg_val |= E1000_TARC0_CB_MULTIQ_3_REQ;
> > > > + /* SPT and KBL Si errata workaround to avoid Tx hang
> > > > */
> > > > + reg_val &= ~BIT(28);
> > > > + reg_val |= BIT(29);
> > > > ew32(TARC(0), reg_val);
> > > > }
> > > > }
> > > >
> > > >
> > > > Patches currently in stable-queue which might be from sasha.neftin@in
> > > > tel.com are
> > > >
> > > > queue-4.14/e1000e-fix-buffer-overrun-while-the-i219-is-processing-
> > > > dma-transactions.patch
> > >
> > > This is good. To follow of this one we have sent (Jeff sent today)
> > > another
> > > one, same functionality but more fundamental and clear patch, please,
> > > refer
> > > to https://patchwork.ozlabs.org/patch/834472/. I believe you can take
> > > it too
> > > for stable build .
> >
> > What is the git commit id of the patch in Linus's tree?
> >
> > You all do know how to properly tag patches to be included automatically
> > in stable releases, right? If so, how come no one does this for this
> > driver?
>
> Sorry Greg, I did not realize the above commit was queued up for stable,
> which is why the follow on commit that Sasha was referring to was not CC'd
> to stable mailing list. I do and will usual add the stable mailing list
> to commits that need to be queued up for the stable trees.
>
> Anyways, here is the commit id for the follow on patch for the changes
> above. David Miller just accepted it into his net tree this morning, here
> is the commit id info:
>
> commit c0f4b163a03e73055dd734eaca64b9580e72e7fb
> Author: Sasha Neftin <sasha.neftin(a)intel.com>
> Date: Mon Nov 6 08:31:59 2017 +0200
>
> e1000e: fix the use of magic numbers for buffer overrun issue
>
> 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(a)intel.com>
> Reviewed-by: Alexander H Duyck <alexander.h.duyck(a)intel.com>
> Reviewed-by: Dima Ruinskiy <dima.ruinskiy(a)intel.com>
> Reviewed-by: Raanan Avargil <raanan.avargil(a)intel.com>
> Tested-by: Aaron Brown <aaron.f.brown(a)intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher(a)intel.com>
Now added to the 4.14-stable tree, thanks.
greg k-h
From: Brent Taylor <motobud(a)gmail.com>
Gregg,
I apologize for the 4.4.y patch, I screwed up the branching
in my local tree and tried to submit one patch that would cover
versions 4.4.y and 3.18.y. Here is a valid 4.4.y patch.
-- Brent
commit 30863e38ebeb500a31cecee8096fb5002677dd9b upstream.
When mtdoops calls mtd_panic_write(), it eventually calls
panic_nand_write() in nand_base.c. In order to properly wait for the
nand chip to be ready in panic_nand_wait(), the chip must first be
selected.
When using the atmel nand flash controller, a panic would occur due to
a NULL pointer exception.
Fixes: 2af7c6539931 ("mtd: Add panic_write for NAND flashes")
Cc: <stable(a)vger.kernel.org> # 4.4.x
Signed-off-by: Brent Taylor <motobud(a)gmail.com>
---
drivers/mtd/nand/nand_base.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 54ab48827258..7ba109e8cf88 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2663,15 +2663,18 @@ static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const uint8_t *buf)
{
struct nand_chip *chip = mtd->priv;
+ int chipnr = (int)(to >> chip->chip_shift);
struct mtd_oob_ops ops;
int ret;
- /* Wait for the device to get ready */
- panic_nand_wait(mtd, chip, 400);
-
/* Grab the device */
panic_nand_get_device(chip, mtd, FL_WRITING);
+ chip->select_chip(mtd, chipnr);
+
+ /* Wait for the device to get ready */
+ panic_nand_wait(mtd, chip, 400);
+
memset(&ops, 0, sizeof(ops));
ops.len = len;
ops.datbuf = (uint8_t *)buf;
--
2.15.0
Hi,
The fix for CVE-2017-16939 has been applied to v4.9.y, but not to v4.4.y
and older kernels. However, I confirmed that running the published POC
(see https://blogs.securiteam.com/index.php/archives/3535) does crash a 4.4
kernel.
I confirmed that the following two patches fix the problem in v4.4.y.
Please consider applying them to v4.4.y (and possibly v3.18.y).
fc9e50f5a5a4e ("netlink: add a start callback for starting a netlink dump")
1137b5e2529a8 ("ipsec: Fix aborted xfrm policy dump crash")
My apologies for the noise if this is already under consideration.
Thanks,
Guenter