Re: [PATCH v2 net-next 1/2] lib: introduce strncpy_from_unsafe()

2015-08-28 Thread Alexei Starovoitov
On 8/28/15 3:11 PM, Steven Rostedt wrote: I personally prefer counting the NUL. I've had issues in the past with the strncpy_from_user() not counting it :-p agreed. will respin with comment fixed. thank you much for review! -- To unsubscribe from this list: send the line "unsubscribe linux-ker

Re: [PATCH v2 net-next 1/2] lib: introduce strncpy_from_unsafe()

2015-08-28 Thread Steven Rostedt
On Fri, 28 Aug 2015 15:08:35 -0700 Alexei Starovoitov wrote: > On 8/28/15 2:48 PM, Steven Rostedt wrote: > >> * On success, returns the length of the string (not including the > >> trailing > >> >+ * NUL). > > I think it includes the NUL. > > oops. yes. that was a copy paste from strncpy_from

Re: [PATCH v2 net-next 1/2] lib: introduce strncpy_from_unsafe()

2015-08-28 Thread Alexei Starovoitov
On 8/28/15 2:48 PM, Steven Rostedt wrote: * On success, returns the length of the string (not including the trailing >+ * NUL). I think it includes the NUL. oops. yes. that was a copy paste from strncpy_from_user comment. trace_kprobe usage wants NUL to be counted, so I intended to have it c

Re: [PATCH v2 net-next 1/2] lib: introduce strncpy_from_unsafe()

2015-08-28 Thread Steven Rostedt
On Fri, 28 Aug 2015 12:51:48 -0700 Alexei Starovoitov wrote: > EXPORT_SYMBOL(strncpy_from_user); > + > +/** > + * strncpy_from_unsafe: - Copy a NUL terminated string from unsafe address. > + * @dst: Destination address, in kernel space. This buffer must be at > + * least @count bytes

[PATCH v2 net-next 1/2] lib: introduce strncpy_from_unsafe()

2015-08-28 Thread Alexei Starovoitov
generalize FETCH_FUNC_NAME(memory, string) into strncpy_from_unsafe() and fix sparse warnings that were present in original implementation. Signed-off-by: Alexei Starovoitov --- include/linux/uaccess.h |2 ++ kernel/trace/trace_kprobe.c | 20 lib/strncpy_from_user.