svn commit: r348843 - head/sys/vm

Shawn Webb shawn.webb at hardenedbsd.org
Mon Jun 10 15:39:17 UTC 2019


On Tue, Jun 11, 2019 at 01:33:23AM +1000, Bruce Evans wrote:
> On Mon, 10 Jun 2019, Shawn Webb wrote:
> 
> > On Mon, Jun 10, 2019 at 03:07:11AM +0000, Doug Moore wrote:
> > > ...
> > > Log:
> > >   There are times when a len==0 parameter to mmap is okay. But on a
> > >   32-bit machine, a len parameter just a few bytes short of 4G, rounded
> > >   up to a page boundary and hitting zero then, is not okay. Return
> > >   failure in that case.
> > > ...
> > >  	/* Adjust size for rounding (on both ends). */
> > >  	size += pageoff;			/* low end... */
> > > -	size = (vm_size_t) round_page(size);	/* hi end */
> > > +	/* Check for rounding up to zero. */
> > > +	if (round_page(size) < size)
> > > +		return (EINVAL);
> > 
> > The mmap(2) manpage says that len==0 results in EINVAL, so the manpage
> > needs updating.
> 
> The man page doesn't say that only len == 0 results in EINVAL, so it is
> not incorrect.

https://github.com/freebsd/freebsd/blob/master/lib/libc/sys/mmap.2#L451-L455

Tons of error conditions listed, one of which is len==0.

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal:    +1 443-546-8752
Tor+XMPP+OTR:        lattera at is.a.hacker.sx
GPG Key ID:          0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20190610/6fdb064a/attachment.sig>


More information about the svn-src-head mailing list