Re: [PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-17 Thread Alexander Potapenko
On Fri, Jul 14, 2017 at 7:54 PM, David Miller wrote: > From: Alexander Potapenko > Date: Fri, 14 Jul 2017 19:33:54 +0200 > >> On Fri, Jul 14, 2017 at 7:23 PM, David Miller wrote: >>> From: Alexander Potapenko >>> Date: Fri, 14 Jul 2017 18:33:01 +0200 >>> On Fri, Jul 14, 2017 at 5:58 PM, Da

Re: [PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-14 Thread kbuild test robot
Hi Alexander, [auto build test WARNING on net-next/master] [also build test WARNING on next-20170714] [cannot apply to v4.12] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Alexander-Potapenko/s

Re: [PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-14 Thread kbuild test robot
Hi Alexander, [auto build test ERROR on net-next/master] [also build test ERROR on next-20170714] [cannot apply to v4.12] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Alexander-Potapenko/sctp-

Re: [PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-14 Thread David Miller
From: Alexander Potapenko Date: Fri, 14 Jul 2017 19:33:54 +0200 > On Fri, Jul 14, 2017 at 7:23 PM, David Miller wrote: >> From: Alexander Potapenko >> Date: Fri, 14 Jul 2017 18:33:01 +0200 >> >>> On Fri, Jul 14, 2017 at 5:58 PM, David Miller wrote: From: Alexander Potapenko Date: Fr

Re: [PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-14 Thread Alexander Potapenko
On Fri, Jul 14, 2017 at 7:23 PM, David Miller wrote: > From: Alexander Potapenko > Date: Fri, 14 Jul 2017 18:33:01 +0200 > >> On Fri, Jul 14, 2017 at 5:58 PM, David Miller wrote: >>> From: Alexander Potapenko >>> Date: Fri, 14 Jul 2017 12:03:29 +0200 >>> v2: per comment from David Miller,

Re: [PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-14 Thread David Miller
From: Alexander Potapenko Date: Fri, 14 Jul 2017 18:33:01 +0200 > On Fri, Jul 14, 2017 at 5:58 PM, David Miller wrote: >> From: Alexander Potapenko >> Date: Fri, 14 Jul 2017 12:03:29 +0200 >> >>> v2: per comment from David Miller, make sure the whole iterator->length >>> fits into the rem

Re: [PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-14 Thread Alexander Potapenko
On Fri, Jul 14, 2017 at 5:58 PM, David Miller wrote: > From: Alexander Potapenko > Date: Fri, 14 Jul 2017 12:03:29 +0200 > >> v2: per comment from David Miller, make sure the whole iterator->length >> fits into the remaining buffer. > > Please compile and functionally test your changes: > >

Re: [PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-14 Thread David Miller
From: Alexander Potapenko Date: Fri, 14 Jul 2017 12:03:29 +0200 > v2: per comment from David Miller, make sure the whole iterator->length > fits into the remaining buffer. Please compile and functionally test your changes: In file included from ./include/linux/compiler.h:58:0,

[PATCH v2] sctp: don't dereference ptr before leaving _sctp_walk_{params,errors}()

2017-07-14 Thread Alexander Potapenko
If the length field of the iterator (|pos.p| or |err|) is past the end of the chunk, we shouldn't access it. This bug has been detected by KMSAN. For the following pair of system calls: socket(PF_INET6, SOCK_STREAM, 0x84 /* IPPROTO_??? */) = 3 sendto(3, "A", 1, MSG_OOB, {sa_family=AF_INET6, s