diff options
author | Chuck Lever | 2020-10-23 10:41:07 -0400 |
---|---|---|
committer | J. Bruce Fields | 2020-11-05 17:20:12 -0500 |
commit | d321ff589c16d8c2207485a6d7fbdb14e873d46e (patch) | |
tree | 77c5378ad2cffdb649d49d5eff95ea37c7eccdbb /include/trace/events/sunrpc.h | |
parent | 1905cac9d621a10358bc2750f8b25b64df439a21 (diff) |
SUNRPC: Fix general protection fault in trace_rpc_xdr_overflow()
The TP_fast_assign() section is careful enough not to dereference
xdr->rqst if it's NULL. The TP_STRUCT__entry section is not.
Fixes: 5582863f450c ("SUNRPC: Add XDR overflow trace event")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'include/trace/events/sunrpc.h')
-rw-r--r-- | include/trace/events/sunrpc.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index f45b3c01370c..2477014e3fa6 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h @@ -655,10 +655,10 @@ TRACE_EVENT(rpc_xdr_overflow, __field(size_t, tail_len) __field(unsigned int, page_len) __field(unsigned int, len) - __string(progname, - xdr->rqst->rq_task->tk_client->cl_program->name) - __string(procedure, - xdr->rqst->rq_task->tk_msg.rpc_proc->p_name) + __string(progname, xdr->rqst ? + xdr->rqst->rq_task->tk_client->cl_program->name : "unknown") + __string(procedure, xdr->rqst ? + xdr->rqst->rq_task->tk_msg.rpc_proc->p_name : "unknown") ), TP_fast_assign( |