1
0
Fork 0
alistair23-linux/net/sunrpc/xprtrdma
Chuck Lever ff04f342f8 xprtrdma: Fix DMA scatter-gather list mapping imbalance
commit ca1c671302 upstream.

The @nents value that was passed to ib_dma_map_sg() has to be passed
to the matching ib_dma_unmap_sg() call. If ib_dma_map_sg() choses to
concatenate sg entries, it will return a different nents value than
it was passed.

The bug was exposed by recent changes to the AMD IOMMU driver, which
enabled sg entry concatenation.

Looking all the way back to commit 4143f34e01 ("xprtrdma: Port to
new memory registration API") and reviewing other kernel ULPs, it's
not clear that the frwr_map() logic was ever correct for this case.

Reported-by: Andre Tomt <andre@tomt.net>
Suggested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: stable@vger.kernel.org
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-19 19:53:02 +01:00
..
Makefile xprtrdma: Remove support for FMR memory registration 2019-01-02 12:05:17 -05:00
backchannel.c SUNRPC: The RDMA back channel mustn't disappear while requests are outstanding 2019-10-30 12:04:35 -04:00
frwr_ops.c xprtrdma: Fix DMA scatter-gather list mapping imbalance 2020-02-19 19:53:02 +01:00
module.c NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00
rpc_rdma.c xprtrdma: Close window between waking RPC senders and posting Receives 2020-01-17 19:48:38 +01:00
svc_rdma.c svcrdma: Remove svc_rdma_wq 2019-08-19 10:59:28 -04:00
svc_rdma_backchannel.c SUNRPC: Fix backchannel latency metrics 2020-01-26 10:00:59 +01:00
svc_rdma_recvfrom.c svcrdma: Use llist for managing cache of recv_ctxts 2019-08-19 10:59:28 -04:00
svc_rdma_rw.c scsi: lib/sg_pool.c: improve APIs for allocating sg pool 2019-06-20 15:21:33 -04:00
svc_rdma_sendto.c svcrdma: Remove syslog warnings in work completion handlers 2019-02-06 15:37:15 -05:00
svc_rdma_transport.c Highlights: 2019-09-27 17:00:27 -07:00
transport.c xprtrdma: Connection becomes unstable after a reconnect 2020-01-17 19:48:38 +01:00
verbs.c xprtrdma: Fix oops in Receive handler after device removal 2020-01-17 19:48:44 +01:00
xprt_rdma.h xprtrdma: Fix oops in Receive handler after device removal 2020-01-17 19:48:44 +01:00