[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4df0dc2a-50d2-4a8f-8a8c-2b2a943f80ae@app.fastmail.com>
Date: Wed, 26 Jul 2023 15:54:11 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Jiri Olsa" <olsajiri@...il.com>, "Arnd Bergmann" <arnd@...nel.org>
Cc: "Alexei Starovoitov" <ast@...nel.org>,
"Daniel Borkmann" <daniel@...earbox.net>,
"Andrii Nakryiko" <andrii@...nel.org>,
"Steven Rostedt" <rostedt@...dmis.org>,
"Masami Hiramatsu" <mhiramat@...nel.org>,
"Luis Chamberlain" <mcgrof@...nel.org>,
"Martin KaFai Lau" <martin.lau@...ux.dev>,
"Song Liu" <song@...nel.org>, "Yonghong Song" <yhs@...com>,
"KP Singh" <kpsingh@...nel.org>,
"Stanislav Fomichev" <sdf@...gle.com>,
"Hao Luo" <haoluo@...gle.com>,
"Mark Rutland" <mark.rutland@....com>,
"Kees Cook" <keescook@...omium.org>,
"Peter Zijlstra" <peterz@...radead.org>,
"Miguel Ojeda" <ojeda@...nel.org>,
"Palmer Dabbelt" <palmer@...osinc.com>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
linux-modules@...r.kernel.org
Subject: Re: [PATCH 2/2] [v2] kallsyms: rework symbol lookup return codes
On Wed, Jul 26, 2023, at 10:02, Jiri Olsa wrote:
> On Mon, Jul 24, 2023 at 03:53:02PM +0200, Arnd Bergmann wrote:
>> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
>> index 05c0024815bf9..bc0eed24a5873 100644
>> --- a/kernel/trace/ftrace.c
>> +++ b/kernel/trace/ftrace.c
>> @@ -6965,7 +6965,7 @@ allocate_ftrace_mod_map(struct module *mod,
>> return mod_map;
>> }
>>
>> -static const char *
>> +static int
>> ftrace_func_address_lookup(struct ftrace_mod_map *mod_map,
>> unsigned long addr, unsigned long *size,
>> unsigned long *off, char *sym)
>> @@ -6986,21 +6986,18 @@ ftrace_func_address_lookup(struct ftrace_mod_map *mod_map,
>> *size = found_func->size;
>> if (off)
>> *off = addr - found_func->ip;
>> - if (sym)
>> - strscpy(sym, found_func->name, KSYM_NAME_LEN);
>> -
>> - return found_func->name;
>> + return strlcpy(sym, found_func->name, KSYM_NAME_LEN);
>
> hi,
> any reason not to call the original strscpy in here?
No, that was a mistake. I replaced the other strcpy and strncpy
with strlcpy in order to get the desired behavior, but in fact
they should all be strscpy, and changing this one was an accident.
I'll send a v3.
Arnd
Powered by blists - more mailing lists