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

2017-03-01 Thread David Miller
From: Alexander Potapenko Date: Wed, 1 Mar 2017 12:57:20 +0100 > KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of > uninitialized memory in packet_bind_spkt(): ... > This happens because addr.sa_data copied from the userspace is not > zero-terminated,

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

2017-03-01 Thread David Miller
From: Alexander Potapenko Date: Wed, 1 Mar 2017 12:57:20 +0100 > KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of > uninitialized memory in packet_bind_spkt(): ... > This happens because addr.sa_data copied from the userspace is not > zero-terminated, and copying it

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

2017-03-01 Thread Cong Wang
On Wed, Mar 1, 2017 at 3:57 AM, Alexander Potapenko wrote: > This happens because addr.sa_data copied from the userspace is not > zero-terminated, and copying it with strlcpy() in packet_bind_spkt() > results in calling strlen() on the kernel copy of that non-terminated >

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

2017-03-01 Thread Cong Wang
On Wed, Mar 1, 2017 at 3:57 AM, Alexander Potapenko wrote: > This happens because addr.sa_data copied from the userspace is not > zero-terminated, and copying it with strlcpy() in packet_bind_spkt() > results in calling strlen() on the kernel copy of that non-terminated > buffer. Very similar to

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

2017-03-01 Thread Eric Dumazet
On Wed, 2017-03-01 at 12:57 +0100, Alexander Potapenko wrote: > KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of > uninitialized memory in packet_bind_spkt(): ... > Signed-off-by: Alexander Potapenko > --- > Changes since v3: > - addressed comments by

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

2017-03-01 Thread Eric Dumazet
On Wed, 2017-03-01 at 12:57 +0100, Alexander Potapenko wrote: > KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of > uninitialized memory in packet_bind_spkt(): ... > Signed-off-by: Alexander Potapenko > --- > Changes since v3: > - addressed comments by Eric Dumazet (avoid

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

2017-03-01 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:

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

2017-03-01 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: