mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Jiri Olsa" <olsajiri@gmail.com>, "Arnd Bergmann" <arnd@kernel.org>
Cc: "Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Martin KaFai Lau" <martin.lau@linux.dev>,
	"Song Liu" <song@kernel.org>, "Yonghong Song" <yhs@fb.com>,
	"KP Singh" <kpsingh@kernel.org>,
	"Stanislav Fomichev" <sdf@google.com>,
	"Hao Luo" <haoluo@google.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Palmer Dabbelt" <palmer@rivosinc.com>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	linux-modules@vger.kernel.org
Subject: Re: [PATCH 2/2] [v2] kallsyms: rework symbol lookup return codes
Date: Wed, 26 Jul 2023 15:54:11 +0200	[thread overview]
Message-ID: <4df0dc2a-50d2-4a8f-8a8c-2b2a943f80ae@app.fastmail.com> (raw)
In-Reply-To: <ZMDS+lM/V5t1qD0D@krava>

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

  reply	other threads:[~2023-07-26 13:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 13:53 [PATCH 1/2] crypto: drivers - avoid memcpy size warning Arnd Bergmann
2023-07-24 13:53 ` [PATCH 2/2] [v2] kallsyms: rework symbol lookup return codes Arnd Bergmann
2023-07-24 19:28   ` Luis Chamberlain
2023-07-26  8:02   ` Jiri Olsa
2023-07-26 13:54     ` Arnd Bergmann [this message]
2023-07-27  5:46 ` [PATCH 1/2] crypto: drivers - avoid memcpy size warning claudiu beznea
2023-08-04  8:16 ` Herbert Xu
2023-08-07 12:04   ` Arnd Bergmann
2023-08-11 10:48     ` Herbert Xu
2023-08-11 13:38       ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4df0dc2a-50d2-4a8f-8a8c-2b2a943f80ae@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andrii@kernel.org \
    --cc=arnd@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=keescook@chromium.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=martin.lau@linux.dev \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=olsajiri@gmail.com \
    --cc=palmer@rivosinc.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®