tracing: Avoid -Warray-bounds warning for __rel_loc macro
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 25 Jan 2022 14:19:30 +0000 (23:19 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:26 +0000 (14:24 +0200)
commit3c0a5a0e1c669ddffd8be49c4fe7ed75ae048c5b
treeb03f122b328624dc6e28e7d459128a009e96ebfa
parent994dea8549f261a49a298773ff6ad793672d8443
tracing: Avoid -Warray-bounds warning for __rel_loc macro

[ Upstream commit 58c5724ec2cdd72b22107ec5de00d90cc4797796 ]

Since -Warray-bounds checks the destination size from the type of given
pointer, __assign_rel_str() macro gets warned because it passes the
pointer to the 'u32' field instead of 'trace_event_raw_*' data structure.
Pass the data address calculated from the 'trace_event_raw_*' instead of
'u32' __rel_loc field.

Link: https://lkml.kernel.org/r/20220125233154.dac280ed36944c0c2fe6f3ac@kernel.org
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
[ This did not fix the warning, but is still a nice clean up ]
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/trace/trace_events.h