Re: [PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-23 Thread Naveen N. Rao
Excerpts from Paul Clarke's message of April 21, 2017 19:22: Sent too soon. The suggestions don't guarantee null termination. Refined, below. (Sorry for the noise.) Yeah, the string operations here are a bit of a minefield... On 04/21/2017 08:33 AM, Paul Clarke wrote: On 04/21/2017 07:33

Re: [PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-21 Thread Paul Clarke
Sent too soon. The suggestions don't guarantee null termination. Refined, below. (Sorry for the noise.) On 04/21/2017 08:33 AM, Paul Clarke wrote: > On 04/21/2017 07:33 AM, Naveen N. Rao wrote: >> Convert usage of strchr()/strncpy()/strncat() to >> strnchr()/memcpy()/strlcat() for simpler and s

Re: [PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-21 Thread Paul Clarke
On 04/21/2017 08:33 AM, Paul Clarke wrote: > On 04/21/2017 07:33 AM, Naveen N. Rao wrote: >> } else if (name[0] != '.') { >> dot_name[0] = '.'; >> dot_name[1] = '\0'; >> -strncat(dot_name, name, KSYM_NAME_LEN - 2); >> +strlcat(dot_name, name, s

Re: [PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-21 Thread Paul Clarke
On 04/21/2017 07:33 AM, Naveen N. Rao wrote: > Convert usage of strchr()/strncpy()/strncat() to > strnchr()/memcpy()/strlcat() for simpler and safer string manipulation. > > Reported-by: David Laight > Signed-off-by: Naveen N. Rao > --- > Changes: Additionally convert the strchr(). > > > arch

[PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-21 Thread Naveen N. Rao
Convert usage of strchr()/strncpy()/strncat() to strnchr()/memcpy()/strlcat() for simpler and safer string manipulation. Reported-by: David Laight Signed-off-by: Naveen N. Rao --- Changes: Additionally convert the strchr(). arch/powerpc/kernel/kprobes.c | 13 ++--- 1 file changed, 6 i