Home Home > GIT Browse > SLE12-SP3-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kirjanov <dkirjanov@suse.com>2019-02-12 16:08:51 +0100
committerDenis Kirjanov <dkirjanov@suse.com>2019-02-12 16:08:51 +0100
commit6debd5c99d25df245d32afe899dc4e8d24ce277e (patch)
treeec822aa562551d3d3a3f197c48fb5228b3439906
parentcf38b6f60d5c4bce31745ace072cb87c6494d55a (diff)
IB/core: type promotion bug in rdma_rw_init_one_mr()
-rw-r--r--patches.drivers/IB-core-type-promotion-bug-in-rdma_rw_init_one_mr.patch35
-rw-r--r--series.conf1
2 files changed, 36 insertions, 0 deletions
diff --git a/patches.drivers/IB-core-type-promotion-bug-in-rdma_rw_init_one_mr.patch b/patches.drivers/IB-core-type-promotion-bug-in-rdma_rw_init_one_mr.patch
new file mode 100644
index 0000000000..f2e73add9b
--- /dev/null
+++ b/patches.drivers/IB-core-type-promotion-bug-in-rdma_rw_init_one_mr.patch
@@ -0,0 +1,35 @@
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Wed, 4 Jul 2018 12:32:12 +0300
+Subject: IB/core: type promotion bug in rdma_rw_init_one_mr()
+Patch-mainline: v4.19-rc1
+Git-commit: c2d7c8ff89b22ddefb1ac2986c0d48444a667689
+References: FATE#321732
+
+"nents" is an unsigned int, so if ib_map_mr_sg() returns a negative
+error code then it's type promoted to a high unsigned int which is
+treated as success.
+
+Fixes: a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
+Acked-by: Denis Kirjanov <dkirjanov@suse.com>
+---
+ drivers/infiniband/core/rw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
+index c8963e91f92a..3ee0adfb45e9 100644
+--- a/drivers/infiniband/core/rw.c
++++ b/drivers/infiniband/core/rw.c
+@@ -87,7 +87,7 @@ static int rdma_rw_init_one_mr(struct ib_qp *qp, u8 port_num,
+ }
+
+ ret = ib_map_mr_sg(reg->mr, sg, nents, &offset, PAGE_SIZE);
+- if (ret < nents) {
++ if (ret < 0 || ret < nents) {
+ ib_mr_pool_put(qp, &qp->rdma_mrs, reg->mr);
+ return -EINVAL;
+ }
+--
+2.12.3
+
diff --git a/series.conf b/series.conf
index 4bc254d98d..f4a8e40c64 100644
--- a/series.conf
+++ b/series.conf
@@ -24007,6 +24007,7 @@
patches.arch/powerpc-64s-move-machine-check-SLB-flushing-to-mm-sl.patch
patches.drivers/iw_cxgb4-remove-duplicate-memcpy-in-c4iw_create_list.patch
patches.drivers/RDMA-i40w-Hold-read-semaphore-while-looking-after-VM.patch
+ patches.drivers/IB-core-type-promotion-bug-in-rdma_rw_init_one_mr.patch
patches.fixes/RDMA-rw-Fix-rdma_rw_ctx_signature_init-kernel-doc-he.patch
patches.fixes/ceph-fix-incorrect-use-of-strncpy.patch
patches.fixes/ceph-return-errors-from-posix_acl_equiv_mode-correctly.patch