mirror of
https://github.com/brain-hackers/linux-brain.git
synced 2024-06-09 23:36:23 +09:00
SUNRPC: stop printk reading past end of string
[ Upstream commit 8c6b6c793ed32b8f9770ebcdf1ba99af423c303b ] Since p points at raw xdr data, there's no guarantee that it's NULL terminated, so we should give a length. And probably escape any special characters too. Reported-by: Zhi Li <yieli@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7b8fb2a4d3
commit
b85406bf1b
|
@ -988,8 +988,8 @@ static int rpcb_dec_getaddr(struct rpc_rqst *req, struct xdr_stream *xdr,
|
||||||
p = xdr_inline_decode(xdr, len);
|
p = xdr_inline_decode(xdr, len);
|
||||||
if (unlikely(p == NULL))
|
if (unlikely(p == NULL))
|
||||||
goto out_fail;
|
goto out_fail;
|
||||||
dprintk("RPC: %5u RPCB_%s reply: %s\n", req->rq_task->tk_pid,
|
dprintk("RPC: %5u RPCB_%s reply: %*pE\n", req->rq_task->tk_pid,
|
||||||
req->rq_task->tk_msg.rpc_proc->p_name, (char *)p);
|
req->rq_task->tk_msg.rpc_proc->p_name, len, (char *)p);
|
||||||
|
|
||||||
if (rpc_uaddr2sockaddr(req->rq_xprt->xprt_net, (char *)p, len,
|
if (rpc_uaddr2sockaddr(req->rq_xprt->xprt_net, (char *)p, len,
|
||||||
sap, sizeof(address)) == 0)
|
sap, sizeof(address)) == 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user