TencentOS-kernel/net/sunrpc
Chuck Lever a42990bfa9 xprtrdma: Fix XDRBUF_SPARSE_PAGES support
commit 15261b9126cd5bb2ad8521da49d8f5c042d904c7 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>
2021-03-16 16:43:33 +08:00
..
auth_gss SUNRPC: fix copying of multiple pages in gss_read_proxy_verf() 2021-03-16 16:39:03 +08:00
xprtrdma xprtrdma: Fix XDRBUF_SPARSE_PAGES support 2021-03-16 16:43:33 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
addr.c net: sunrpc: Fix off-by-one issues in 'rpc_ntop6' 2021-03-16 16:30:26 +08:00
auth.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
auth_null.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
auth_unix.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
backchannel_rqst.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cache.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
clnt.c SUNRPC: Signalled ASYNC tasks need to exit 2021-03-16 16:27:56 +08:00
debugfs.c net: sunrpc: Fix 'snprintf' return value check in 'do_xprt_debugfs' 2021-03-16 16:42:59 +08:00
netns.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rpc_pipe.c sunrpc: fixed rollback in rpc_gssd_dummy_populate() 2021-03-16 16:31:12 +08:00
rpcb_clnt.c SUNRPC: stop printk reading past end of string 2021-03-16 16:36:13 +08:00
sched.c SUNRPC: rpc_wake_up() should wake up tasks in the correct order 2021-03-16 16:42:58 +08:00
socklib.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
stats.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sunrpc.h sunrpc: check that domain table is empty at module unload. 2021-03-16 16:32:44 +08:00
sunrpc_syms.c sunrpc: check that domain table is empty at module unload. 2021-03-16 16:32:44 +08:00
svc.c nfsd: Fix NFSv4 READ on RDMA when using readv 2021-03-16 16:33:11 +08:00
svc_xprt.c SUNRPC: Fix a potential buffer overflow in 'svc_print_xprts()' 2021-03-16 16:37:08 +08:00
svcauth.c sunrpc: check that domain table is empty at module unload. 2021-03-16 16:32:44 +08:00
svcauth_unix.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
svcsock.c nfsd: Fix NFSv4 READ on RDMA when using readv 2021-03-16 16:33:11 +08:00
sysctl.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
timer.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
xdr.c SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment() 2021-03-16 16:31:12 +08:00
xprt.c SUNRPC: xprt_load_transport() needs to support the netid "rdma6" 2021-03-16 16:42:59 +08:00
xprtmultipath.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
xprtsock.c sunrpc: fix xs_read_xdr_buf for partial pages receive 2021-03-16 16:43:14 +08:00