Re: [PATCH 2/2] tracing: Stop fortify-string from warning in tracing_mark_raw_write()
From: Steven Rostedt
Date: Mon Oct 13 2025 - 13:05:37 EST
On Sun, 12 Oct 2025 12:34:08 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:
> > Use a void pointer and get the offset via offsetof() to keep fortify
> > string from warning about this copy.
> >
> > Cc: stable@xxxxxxxxxxxxxxx
> > Fixes: 64cf7d058a00 ("tracing: Have trace_marker use per-cpu data to read user space")
> > Reported-by: syzbot+9a2ede1643175f350105@xxxxxxxxxxxxxxxxxxxxxxxxx
> > Closes: https://lore.kernel.org/all/68e973f5.050a0220.1186a4.0010.GAE@xxxxxxxxxx/
> > Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
>
> Ah, fixed already.
>
> Acked-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
Actually this was the wrong fix. Before submitting a pull request, I looked
to see if there was a better way to handle this and discovered "unsafe_memcpy()"
which is the proper solution:
https://lore.kernel.org/all/20251011112032.77be18e4@xxxxxxxxxxxxxxxxxx/
-- Steve