]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
SUNRPC: Fix rpcgss_context trace event acceptor field
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 10 Apr 2024 16:38:13 +0000 (12:38 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Wed, 10 Apr 2024 23:01:30 +0000 (19:01 -0400)
commita4833e3abae132d613ce7da0e0c9a9465d1681fa
tree4a5d651f8edc084e0abb52ad901e19999afa954a
parent10396f4df8b75ff6ab0aa2cd74296565466f2c8d
SUNRPC: Fix rpcgss_context trace event acceptor field

The rpcgss_context trace event acceptor field is a dynamically sized
string that records the "data" parameter. But this parameter is also
dependent on the "len" field to determine the size of the data.

It needs to use __string_len() helper macro where the length can be passed
in. It also incorrectly uses strncpy() to save it instead of
__assign_str(). As these macros can change, it is not wise to open code
them in trace events.

As of commit c759e609030c ("tracing: Remove __assign_str_len()"),
__assign_str() can be used for both __string() and __string_len() fields.
Before that commit, __assign_str_len() is required to be used. This needs
to be noted for backporting. (In actuality, commit c1fa617caeb0 ("tracing:
Rework __assign_str() and __string() to not duplicate getting the string")
is the commit that makes __string_str_len() obsolete).

Cc: stable@vger.kernel.org
Fixes: 0c77668ddb4e ("SUNRPC: Introduce trace points in rpc_auth_gss.ko")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/trace/events/rpcgss.h