Re: net: socket: NULL ptr deref in sendmsg

2014-07-28 Thread David Miller
From: Hannes Frederic Sowa Date: Sat, 26 Jul 2014 17:54:40 +0200 > On Sa, 2014-07-26 at 19:48 +0400, Andrey Ryabinin wrote: >> 2014-07-26 2:15 GMT+04:00 Hannes Frederic Sowa : >> > Otherwise I would just set msg_namelen = 0, too, and just not handle >> > passed in NULL pointers to sockaddrs. >> >

Re: net: socket: NULL ptr deref in sendmsg

2014-07-26 Thread Hannes Frederic Sowa
On Sa, 2014-07-26 at 19:48 +0400, Andrey Ryabinin wrote: > 2014-07-26 2:15 GMT+04:00 Hannes Frederic Sowa : > > Otherwise I would just set msg_namelen = 0, too, and just not handle > > passed in NULL pointers to sockaddrs. > > > > I like that, how about such chage: > > diff --git a/net/compat.c b

Re: net: socket: NULL ptr deref in sendmsg

2014-07-26 Thread Andrey Ryabinin
2014-07-26 2:15 GMT+04:00 Hannes Frederic Sowa : > > Thanks for looking at this! I certainly have overlooked this case. > > I wonder, if we allow sendto with valid NULL pointer and positive > msg_namelen to work, why don't we do the same for recvmsg, as in > replacing the VERIFY_WRITE case non-null

Re: net: socket: NULL ptr deref in sendmsg

2014-07-26 Thread Andrey Ryabinin
2014-07-26 0:52 GMT+04:00 Sasha Levin : > On 07/25/2014 11:23 AM, Andrey Ryabinin wrote: >> After this report there was no usual "Unable to handle kernel NULL pointer >> dereference" >> and this gave me a clue that address 0 is mapped and contains valid socket >> address structure in it. > > Inte

Re: net: socket: NULL ptr deref in sendmsg

2014-07-25 Thread Hannes Frederic Sowa
On Fr, 2014-07-25 at 19:23 +0400, Andrey Ryabinin wrote: > On 07/14/14 01:50, Sasha Levin wrote: > > > > > I've tried debugging it, but I don't see a code path that could lead to > > that. > > > > I finally found some time to take look at this and I've found where the > problem is. > > Sasha

Re: net: socket: NULL ptr deref in sendmsg

2014-07-25 Thread Hannes Frederic Sowa
On Fr, 2014-07-25 at 16:52 -0400, Sasha Levin wrote: > On 07/25/2014 11:23 AM, Andrey Ryabinin wrote: > > After this report there was no usual "Unable to handle kernel NULL pointer > > dereference" > > and this gave me a clue that address 0 is mapped and contains valid socket > > address structur

Re: net: socket: NULL ptr deref in sendmsg

2014-07-25 Thread Sasha Levin
On 07/25/2014 11:23 AM, Andrey Ryabinin wrote: > After this report there was no usual "Unable to handle kernel NULL pointer > dereference" > and this gave me a clue that address 0 is mapped and contains valid socket > address structure in it. Interesting. Does it mean that all network protocols

Re: net: socket: NULL ptr deref in sendmsg

2014-07-25 Thread Eric Dumazet
On Fri, 2014-07-25 at 19:23 +0400, Andrey Ryabinin wrote: > On 07/14/14 01:50, Sasha Levin wrote: > > > > > I've tried debugging it, but I don't see a code path that could lead to > > that. > > > > I finally found some time to take look at this and I've found where the > problem is. > > Sash

Re: net: socket: NULL ptr deref in sendmsg

2014-07-25 Thread Andrey Ryabinin
On 07/14/14 01:50, Sasha Levin wrote: > > I've tried debugging it, but I don't see a code path that could lead to that. > I finally found some time to take look at this and I've found where the problem is. Sasha, I suppose there was no usual "Unable to handle NULL pointer deference" after KA

Re: net: socket: NULL ptr deref in sendmsg

2014-07-24 Thread Sasha Levin
On 07/14/2014 06:08 PM, David Miller wrote: > From: Sasha Levin > Date: Sun, 13 Jul 2014 17:50:53 -0400 > >> While fuzzing with trinity inside a KVM tools guest running the latest -next >> kernel with the KASAN patchset, I've stumbled on the following spew: > ... >> It's similar to another varia

Re: net: socket: NULL ptr deref in sendmsg

2014-07-14 Thread David Miller
From: Sasha Levin Date: Sun, 13 Jul 2014 17:50:53 -0400 > While fuzzing with trinity inside a KVM tools guest running the latest -next > kernel with the KASAN patchset, I've stumbled on the following spew: ... > It's similar to another variation: ... > I've tried debugging it, but I don't see a

net: socket: NULL ptr deref in sendmsg

2014-07-13 Thread Sasha Levin
Hi all, While fuzzing with trinity inside a KVM tools guest running the latest -next kernel with the KASAN patchset, I've stumbled on the following spew: [ 4448.949424] == [ 4448.951737] AddressSanitizer: user-memory-access on addre