Re: [PATCH] net: don't call strlen() on the user buffer in packet_bind_spkt()

2017-02-28 Thread Eric Dumazet
On Tue, 2017-02-28 at 14:47 +0100, Alexander Potapenko wrote: > SGTM. Shall I send the updated patch? (Sorry for asking, the patch > culture is hard) It is always nice to wait for feedback(s), before sending a v2, and a v3, and a v4. Sending 4 patches in one hour is considered not friendly ;) S

Re: [PATCH] net: don't call strlen() on the user buffer in packet_bind_spkt()

2017-02-28 Thread Alexander Potapenko
On Tue, Feb 28, 2017 at 2:42 PM, Eric Dumazet wrote: > On Tue, 2017-02-28 at 05:33 -0800, Eric Dumazet wrote: > >> It looks a bug in this implementation of strlcpy() then. >> > > Apparently strlcpy(dest, src, size) returns strlen(src), so we can not > use it in this context. Good point. >> sizeof

Re: [PATCH] net: don't call strlen() on the user buffer in packet_bind_spkt()

2017-02-28 Thread Alexander Potapenko
On Tue, Feb 28, 2017 at 2:33 PM, Eric Dumazet wrote: > On Tue, 2017-02-28 at 14:17 +0100, Alexander Potapenko wrote: >> KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of >> uninitialized memory in packet_bind_spkt(): >> >>

Re: [PATCH] net: don't call strlen() on the user buffer in packet_bind_spkt()

2017-02-28 Thread Eric Dumazet
On Tue, 2017-02-28 at 05:33 -0800, Eric Dumazet wrote: > It looks a bug in this implementation of strlcpy() then. > Apparently strlcpy(dest, src, size) returns strlen(src), so we can not use it in this context. > sizeof(name) is 15. > > If you use strncpy(X, uaddr->sa_data, 15) , then you mig

Re: [PATCH] net: don't call strlen() on the user buffer in packet_bind_spkt()

2017-02-28 Thread Eric Dumazet
On Tue, 2017-02-28 at 14:17 +0100, Alexander Potapenko wrote: > KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of > uninitialized memory in packet_bind_spkt(): > > == > BUG: KMSAN: use of unitialized memory > CP

[PATCH] net: don't call strlen() on the user buffer in packet_bind_spkt()

2017-02-28 Thread Alexander Potapenko
KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of uninitialized memory in packet_bind_spkt(): == BUG: KMSAN: use of unitialized memory CPU: 0 PID: 1074 Comm: packet Not tainted 4.8.0-rc6+ #1891 Hardware name: QE

[PATCH] net: don't call strlen() on the user buffer in packet_bind_spkt()

2017-02-28 Thread Alexander Potapenko
KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of uninitialized memory in packet_bind_spkt(): == BUG: KMSAN: use of unitialized memory CPU: 0 PID: 1074 Comm: packet Not tainted 4.8.0-rc6+ #1891 Hardware name: QE