SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment()
authorChuck Lever <chuck.lever@oracle.com>
Thu, 25 Jun 2020 15:32:34 +0000 (11:32 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 26 Jun 2020 12:45:23 +0000 (08:45 -0400)
commit89a3c9f5b9f0bcaa9aea3e8b2a616fcaea9aad78
tree262957a2edb739066cd14d4894b4f091655be7dd
parentd03727b248d0dae6199569a8d7b629a681154633
SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment()

@subbuf is an output parameter of xdr_buf_subsegment(). A survey of
call sites shows that @subbuf is always uninitialized before
xdr_buf_segment() is invoked by callers.

There are some execution paths through xdr_buf_subsegment() that do
not set all of the fields in @subbuf, leaving some pointer fields
containing garbage addresses. Subsequent processing of that buffer
then results in a page fault.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xdr.c