* [PATCH v1 for-rc] RDMA/siw: Fix page address mapping in TX path
@ 2019-09-09 13:24 Bernard Metzler
2019-09-12 14:50 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Bernard Metzler @ 2019-09-09 13:24 UTC (permalink / raw)
To: linux-rdma; +Cc: krishna2, dledford, Bernard Metzler
Use the correct kmap()/kunmap() flow to determine page
address used for CRC computation. Using page_address()
is wrong, since page might be in highmem.
Reported-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
Fixes: b9be6f18cf9e rdma/siw: transmit path
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
---
drivers/infiniband/sw/siw/siw_qp_tx.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c
index 438a2917a47c..8e72f955921d 100644
--- a/drivers/infiniband/sw/siw/siw_qp_tx.c
+++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
@@ -518,11 +518,12 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s)
c_tx->mpa_crc_hd,
iov[seg].iov_base,
plen);
- } else if (do_crc)
- crypto_shash_update(
- c_tx->mpa_crc_hd,
- page_address(p) + fp_off,
- plen);
+ } else if (do_crc) {
+ crypto_shash_update(c_tx->mpa_crc_hd,
+ kmap(p) + fp_off,
+ plen);
+ kunmap(p);
+ }
} else {
u64 va = sge->laddr + sge_off;
--
2.17.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1 for-rc] RDMA/siw: Fix page address mapping in TX path
2019-09-09 13:24 [PATCH v1 for-rc] RDMA/siw: Fix page address mapping in TX path Bernard Metzler
@ 2019-09-12 14:50 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2019-09-12 14:50 UTC (permalink / raw)
To: Bernard Metzler; +Cc: linux-rdma, krishna2, dledford
On Mon, Sep 09, 2019 at 03:24:27PM +0200, Bernard Metzler wrote:
> Use the correct kmap()/kunmap() flow to determine page
> address used for CRC computation. Using page_address()
> is wrong, since page might be in highmem.
>
> Reported-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
> Fixes: b9be6f18cf9e rdma/siw: transmit path
> Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
> ---
> drivers/infiniband/sw/siw/siw_qp_tx.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-12 14:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09 13:24 [PATCH v1 for-rc] RDMA/siw: Fix page address mapping in TX path Bernard Metzler
2019-09-12 14:50 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).