Re: [PATCH 3.16 310/366] vmxnet3: fix checks for dma mapping errors

Ben Hutchings
2019-03-29T23:55:42Z

[-- Attachment #1.1: Type: text/plain, Size: 1622 bytes --]

On Fri, 2019-03-29 at 17:01 +0100, Thomas Weißschuh wrote:
> Hi Ben,
>
> I forgot you to Cc: on the following mail:
>
> https://lore.kernel.org/stable/20190329154756.GA14540@fralrnd0033.fra.amadeus.net/
>
> Thomas
>
> On Fri, Mar 29, 2019 at 04:47:58PM +0100, Thomas Weißschuh wrote:
> > > 3.16.60-rc1 review patch. If anyone has any objections, please let me know.
> >
> > Sorry for the late response, this just hit the kernel in Debian Jessie
> > (oldstable) a few days ago.
> >
> > > ------------------
> > >
> > > From: Alexey Khoroshilov <khoroshilov@ispras.ru>
> > >
> > > commit 5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c upstream.
> > >
> > > vmxnet3_drv does not check dma_addr with dma_mapping_error()
> > > after mapping dma memory. The patch adds the checks and
> > > tries to handle failures.
> >
> > We are seeing kernel panics/machine freezes/BUGs with the new 3.16.64 from Debian.
> > I bisected it with the vanilla stable kernel and it boiled down to this commit.
> > VMs of multiple nodes of our vmware cluster are affected.
> > The bug can be triggered in multiple ways, I have seen it when an external
> > network request is served, when installing packages over the network and
> > performing a git clone.
[...]

I missed the upstream follow-up to this, which was commit 58caf637365f
"Driver: Vmxnet3: Fix regression caused by 5738a09".

I'm attaching a backport of that. I don't have any VMware installation
to test on; could you do that?

Ben.

--
Ben Hutchings
It is easier to change the specification to fit the program
than vice versa.

[-- Attachment #1.2: driver-vmxnet3-fix-regression-caused-by-5738a09.patch --]
[-- Type: text/x-patch, Size: 1700 bytes --]

From: Shrikrishna Khare <skhare@vmware.com>
Date: Wed, 6 Jan 2016 10:44:27 -0800
Subject: Driver: Vmxnet3: Fix regression caused by 5738a09
Origin: https://git.kernel.org/linus/58caf637365fef97c8e84ea5699a8e34d68fce93

Reported-by: Bingkuo Liu <bingkuol@vmware.com>
Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16:
- Bump version from 1.2.2.0-k to 1.2.3.0-k, which wasn't used in mainline
- Adjust context, indentation]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
drivers/net/vmxnet3/vmxnet3_drv.c | 8 ++++----
drivers/net/vmxnet3/vmxnet3_int.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1308,9 +1308,9 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx
goto rcd_done;
}
new_dma_addr = dma_map_page(&adapter->pdev->dev,
- rbi->page,
- 0, PAGE_SIZE,
- PCI_DMA_FROMDEVICE);
+ new_page,
+ 0, PAGE_SIZE,
+ PCI_DMA_FROMDEVICE);
if (dma_mapping_error(&adapter->pdev->dev,
new_dma_addr)) {
put_page(new_page);
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -69,12 +69,12 @@
/*
* Version numbers
*/
-#define VMXNET3_DRIVER_VERSION_STRING "1.2.2.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING "1.2.3.0-k"

/* Each byte of this 32-bit integer encodes a version number in
* VMXNET3_DRIVER_VERSION_STRING.
*/
-#define VMXNET3_DRIVER_VERSION_NUM 0x01020200
+#define VMXNET3_DRIVER_VERSION_NUM 0x01020300

#if defined(CONFIG_PCI_MSI)
/* RSS only makes sense if MSI-X is supported. */

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]