[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221011175831.3dd2d460@rorschach.local.home>
Date: Tue, 11 Oct 2022 17:58:31 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Tom Zanussi <zanussi@...nel.org>, stable@...r.kernel.org
Subject: Re: [PATCH 2/2] tracing: Fix reading strings from synthetic events
On Tue, 11 Oct 2022 17:25:03 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> @@ -417,19 +420,28 @@ static unsigned int trace_string(struct synth_trace_event *entry,
> data_offset += event->n_u64 * sizeof(u64);
> data_offset += data_size;
>
> - str_field = (char *)entry + data_offset;
> -
> - len = strlen(str_val) + 1;
> - strscpy(str_field, str_val, len);
> -
> + len = kern_fetch_store_strlen(str_val) + 1;
> + if (len == 1)
> + len = strlen("fault") + 1;
> data_offset |= len << 16;
> *(u32 *)&entry->fields[*n_u64] = data_offset;
>
> + kern_fetch_store_string((unsigned long)str_val, &entry->fields[*n_u64], entry);
> +
This isn't working quite right on faults. I'll be sending a v2 later.
-- Steve
Powered by blists - more mailing lists