1
0
Fork 0
alistair23-linux/net/sunrpc/xprtrdma
Chuck Lever 3ee6a2bc14 xprtrdma: Fix XDRBUF_SPARSE_PAGES support
commit 15261b9126 upstream.

Olga K. observed that rpcrdma_marsh_req() allocates sparse pages
only when it has determined that a Reply chunk is necessary. There
are plenty of cases where no Reply chunk is needed, but the
XDRBUF_SPARSE_PAGES flag is set. The result would be a crash in
rpcrdma_inline_fixup() when it tries to copy parts of the received
Reply into a missing page.

To avoid crashing, handle sparse page allocation up front.

Until XATTR support was added, this issue did not appear often
because the only SPARSE_PAGES consumer always expected a reply large
enough to always require a Reply chunk.

Reported-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:51:38 +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 SUNRPC: xprt_load_transport() needs to support the netid "rdma6" 2020-12-30 11:51:16 +01:00
rpc_rdma.c xprtrdma: Fix XDRBUF_SPARSE_PAGES support 2020-12-30 11:51:38 +01:00
svc_rdma.c svcrdma: Remove svc_rdma_wq 2019-08-19 10:59:28 -04:00
svc_rdma_backchannel.c svcrdma: Fix backchannel return code 2020-10-01 13:18:01 +02:00
svc_rdma_recvfrom.c svcrdma: Fix backchannel return code 2020-10-01 13:18:01 +02:00
svc_rdma_rw.c svcrdma: Fix page leak in svc_rdma_recv_read_chunk() 2020-08-19 08:16:21 +02:00
svc_rdma_sendto.c svcrdma: fix bounce buffers for unaligned offsets and multiple pages 2020-10-29 09:57:55 +01:00
svc_rdma_transport.c nfsd: Fix NFSv4 READ on RDMA when using readv 2020-08-11 15:33:42 +02:00
transport.c SUNRPC: xprt_load_transport() needs to support the netid "rdma6" 2020-12-30 11:51:16 +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