Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-08 Thread Brooks Davis
On Mon, Jan 08, 2018 at 04:13:42PM +0100, Ed Schouten wrote: > Hi Andrew, > > 2018-01-08 8:37 GMT+01:00 Andrew Turner : > > Won???t this lead to a NULL pointer dereference on overflow? mallocarray > > can return NULL even with M_WAITOK. > > Yes, it will, but an overflow

Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-08 Thread Warner Losh
On Mon, Jan 8, 2018 at 9:29 AM, Mark Johnston wrote: > On Mon, Jan 08, 2018 at 09:18:28AM -0700, Ian Lepore wrote: > > On Mon, 2018-01-08 at 09:13 -0700, Warner Losh wrote: > > > On Jan 8, 2018 8:37 AM, "Pedro Giffuni" wrote: > > > On 01/08/18 10:13, Ed

Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-08 Thread Mark Johnston
On Mon, Jan 08, 2018 at 09:18:28AM -0700, Ian Lepore wrote: > On Mon, 2018-01-08 at 09:13 -0700, Warner Losh wrote: > > On Jan 8, 2018 8:37 AM, "Pedro Giffuni" wrote: > > On 01/08/18 10:13, Ed Schouten wrote: > > > > > > > > Hi Andrew, > > > > > > 2018-01-08 8:37 GMT+01:00

Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-08 Thread Ian Lepore
On Mon, 2018-01-08 at 09:13 -0700, Warner Losh wrote: > On Jan 8, 2018 8:37 AM, "Pedro Giffuni" wrote: > > > On 01/08/18 10:13, Ed Schouten wrote: > > > > > Hi Andrew, > > > > 2018-01-08 8:37 GMT+01:00 Andrew Turner : > > > > > > > > Won’t this lead

Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-08 Thread Warner Losh
On Jan 8, 2018 8:37 AM, "Pedro Giffuni" wrote: On 01/08/18 10:13, Ed Schouten wrote: > Hi Andrew, > > 2018-01-08 8:37 GMT+01:00 Andrew Turner : > >> Won’t this lead to a NULL pointer dereference on overflow? mallocarray >> can return NULL even with

Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-08 Thread Pedro Giffuni
On 01/08/18 10:13, Ed Schouten wrote: Hi Andrew, 2018-01-08 8:37 GMT+01:00 Andrew Turner : Won’t this lead to a NULL pointer dereference on overflow? mallocarray can return NULL even with M_WAITOK. Yes, it will, but an overflow shouldn't happen in the first place.

Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-08 Thread Pedro Giffuni
Hi; On 08/01/2018 02:37, Andrew Turner wrote: On 7 Jan 2018, at 22:38, Ed Schouten wrote: Author: ed Date: Sun Jan 7 22:38:45 2018 New Revision: 327684 URL: https://svnweb.freebsd.org/changeset/base/327684 Log: Use mallocarray(9) in CloudABI kernel code where possible.

Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-08 Thread Ed Schouten
Hi Andrew, 2018-01-08 8:37 GMT+01:00 Andrew Turner : > Won’t this lead to a NULL pointer dereference on overflow? mallocarray can > return NULL even with M_WAITOK. Yes, it will, but an overflow shouldn't happen in the first place. ri_data_len is compared with UIO_MAXIOV a

Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-07 Thread Andrew Turner
> On 7 Jan 2018, at 22:38, Ed Schouten wrote: > > Author: ed > Date: Sun Jan 7 22:38:45 2018 > New Revision: 327684 > URL: https://svnweb.freebsd.org/changeset/base/327684 > > Log: > Use mallocarray(9) in CloudABI kernel code where possible. > > Submitted by:pfg@

svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64

2018-01-07 Thread Ed Schouten
Author: ed Date: Sun Jan 7 22:38:45 2018 New Revision: 327684 URL: https://svnweb.freebsd.org/changeset/base/327684 Log: Use mallocarray(9) in CloudABI kernel code where possible. Submitted by: pfg@ Modified: head/sys/compat/cloudabi32/cloudabi32_sock.c