All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA: null pointer in __ib_umem_release causes kernel panic
@ 2022-01-05 14:18 trondmy
  2022-01-05 14:37 ` Jason Gunthorpe
  0 siblings, 1 reply; 7+ messages in thread
From: trondmy @ 2022-01-05 14:18 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: linux-rdma, linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

When doing RPC/RDMA, we're seeing a kernel panic when __ib_umem_release()
iterates over the scatter gather list and hits NULL pages.

It turns out that commit 79fbd3e1241c ended up changing the iteration
from being over only the mapped entries to being over the original list
size.

Fixes: 79fbd3e1241c ("RDMA: Use the sg_table directly and remove the opencoded version from umem")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 drivers/infiniband/core/umem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index 86d479772fbc..59304bae13ca 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -55,7 +55,7 @@ static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int d
 		ib_dma_unmap_sgtable_attrs(dev, &umem->sgt_append.sgt,
 					   DMA_BIDIRECTIONAL, 0);
 
-	for_each_sgtable_sg(&umem->sgt_append.sgt, sg, i)
+	for_each_sgtable_dma_sg(&umem->sgt_append.sgt, sg, i)
 		unpin_user_page_range_dirty_lock(sg_page(sg),
 			DIV_ROUND_UP(sg->length, PAGE_SIZE), make_dirty);
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-05 17:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 14:18 [PATCH] RDMA: null pointer in __ib_umem_release causes kernel panic trondmy
2022-01-05 14:37 ` Jason Gunthorpe
2022-01-05 15:02   ` Trond Myklebust
2022-01-05 16:09     ` Jason Gunthorpe
2022-01-05 17:16       ` Trond Myklebust
2022-01-05 17:43         ` Jason Gunthorpe
2022-01-05 17:49           ` Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.