Home Home > GIT Browse > SLE12-SP5-UPDATE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-10-16 14:33:49 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-10-16 14:33:49 +0200
commit983d37e2cdca7bbc93af99ba0d8d69fff595818d (patch)
treebbf7e29577828ca2926c361851020e9150ceec95
parentfec3515c5412c6fe679010872fc884ce79f9df13 (diff)
Refresh patches.suse/RDMA-cxgb4-Do-not-dma-memory-off-of-the-stack.patch
Add upstream metadata, fix build warning.
-rw-r--r--patches.suse/RDMA-cxgb4-Do-not-dma-memory-off-of-the-stack.patch (renamed from patches.suse/cxgb4-fix-dma-on-stack.patch)32
-rw-r--r--series.conf2
2 files changed, 20 insertions, 14 deletions
diff --git a/patches.suse/cxgb4-fix-dma-on-stack.patch b/patches.suse/RDMA-cxgb4-Do-not-dma-memory-off-of-the-stack.patch
index 9944b8a06f..dae24ada3e 100644
--- a/patches.suse/cxgb4-fix-dma-on-stack.patch
+++ b/patches.suse/RDMA-cxgb4-Do-not-dma-memory-off-of-the-stack.patch
@@ -1,29 +1,33 @@
-From: Denis Kirjanov <denis.kirjanov@suse.com>
-Subject: [PATCH v2] cxgb4: do not dma memory off of the stack
+From 3840c5b78803b2b6cc1ff820100a74a092c40cbb Mon Sep 17 00:00:00 2001
+From: Greg KH <gregkh@linuxfoundation.org>
+Date: Tue, 1 Oct 2019 18:56:11 +0200
+Subject: [PATCH] RDMA/cxgb4: Do not dma memory off of the stack
References: bsc#1152790
-Patch-mainline: No, not yet
+Patch-mainline: v5.4-rc3
+Git-commit: 3840c5b78803b2b6cc1ff820100a74a092c40cbb
Nicolas pointed out that the cxgb4 driver is doing dma off of the stack,
-which is generally considered a very bad thing. On some architectures
-it could be a security problem, but odds are none of them actually run
-this driver, so it's just a "normal" bug.
+which is generally considered a very bad thing. On some architectures it
+could be a security problem, but odds are none of them actually run this
+driver, so it's just a "normal" bug.
Resolve this by allocating the memory for a message off of the heap
instead of the stack. kmalloc() always will give us a proper memory
location that DMA will work correctly from.
+Link: https://lore.kernel.org/r/20191001165611.GA3542072@kroah.com
Reported-by: Nicolas Waisman <nico@semmle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Tested-by: Potnuri Bharat Teja <bharat@chelsio.com>
+Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: Denis Kirjanov <denis.kirjanov@suse.com>
---
- v2: clean up memory on error case, pointed out by Nicolas
- v1: https://lore.kernel.org/r/20191001153917.GA3498459@kroah.com
- Test-built only, I don't have this hardware to actually run this
- code at all.
+ drivers/infiniband/hw/cxgb4/mem.c | 28 +++++++++++++++++-----------
+ 1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
-index 7a5569f9fa8b..8daa7ce9eb4d 100644
+index aa772ee0706f..35c284af574d 100644
--- a/drivers/infiniband/hw/cxgb4/mem.c
+++ b/drivers/infiniband/hw/cxgb4/mem.c
@@ -275,13 +275,17 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
@@ -58,7 +62,7 @@ index 7a5569f9fa8b..8daa7ce9eb4d 100644
/* write TPT entry */
if (reset_tpt_entry)
- memset(&tpt, 0, sizeof(tpt));
-+ memset(tpt, 0, sizeof(tpt));
++ memset(tpt, 0, sizeof(*tpt));
else {
- tpt.valid_to_pdid = cpu_to_be32(FW_RI_TPTE_VALID_F |
+ tpt->valid_to_pdid = cpu_to_be32(FW_RI_TPTE_VALID_F |
@@ -99,5 +103,7 @@ index 7a5569f9fa8b..8daa7ce9eb4d 100644
+ kfree(tpt);
return err;
}
-
+
+--
+2.23.0
diff --git a/series.conf b/series.conf
index 3eb0f024dc..d25bde3f85 100644
--- a/series.conf
+++ b/series.conf
@@ -50073,6 +50073,7 @@
patches.suse/scsi-qla2xxx-Optimize-NPIV-tear-down-process.patch
patches.suse/scsi-qla2xxx-Fix-N2N-link-reset.patch
patches.suse/scsi-qla2xxx-Fix-N2N-link-up-fail.patch
+ patches.suse/RDMA-cxgb4-Do-not-dma-memory-off-of-the-stack.patch
# jejb/scsi for-next
patches.suse/scsi-qla2xxx-Fix-Nport-ID-display-value.patch
@@ -50578,7 +50579,6 @@
########################################################
# Out-of-tree networking
########################################################
- patches.suse/cxgb4-fix-dma-on-stack.patch
patches.suse/bsc1084332-0003-lan78xx-Enable-LEDs-and-auto-negotiation.patch
patches.suse/ibmveth-Update-ethtool-settings-to-reflect-virtual-p.patch
patches.suse/irda-Fix-memory-leak-caused-by-repeated-binds-of-ird.patch