From owner-svn-src-all@freebsd.org Mon Jun 10 15:39:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4978E15C24B1 for ; Mon, 10 Jun 2019 15:39:17 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-vk1-xa32.google.com (mail-vk1-xa32.google.com [IPv6:2607:f8b0:4864:20::a32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3E1780482 for ; Mon, 10 Jun 2019 15:39:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-vk1-xa32.google.com with SMTP id p24so1753063vki.5 for ; Mon, 10 Jun 2019 08:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tIo1ypD94PR8SSbexTEUrh16u4xIKaycns7OJHmcnX0=; b=BDWVHY7MMKSEZ8s8n470+e9JZ1zGeWFeUrE8l5jM0JWds10Jo+EE/Xwc7F7ZaF5XZ7 Db9FdqZTGX9x3wkfQdD/PVHg+QhHrFu7/dHuWfCh+17tzYKE9SHRbtT+ztxpN/2bJWK9 XbXaYqlqEmHytCuOU+JQpYnBdzJ1jsaWSgo+ppIEDvxlhjkOpEn+MK/WpSzi5VfI+hx5 aeL8sUfzTmUM7YVIXk8kQuLIQxNHTKn218JwbvG5FemUwaklyTu+WNQ2fRuMk7wuvSqS arBC5ZiSbieSr5JYUziAkH5DuIPp0gnLQk9z78bjb+PDBRLN0fgPVSVXMK/W4fMIx6sc yxAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tIo1ypD94PR8SSbexTEUrh16u4xIKaycns7OJHmcnX0=; b=TRbootAj4R2tZ/O36vjaftP7CGd1uHwBPOTewPzolE59mcAQG65AcJBLV6tWaoUBw9 NbD1okHuqDOcOYeI9PmAWxg/voryxISKntkO46mzW1HEipl2tMiU4NfoR5jE1TUMhSyW pufmlI6gRqozHcvtFmlU3CcBrxawEiy3ptwBOa4qoi2rruJp2qS2RZ7tZ8G/rU75XxND Kb6CKfJCqaTAd7xX3wKAvcH9D4cH/AjUCt2CZ/EdBo/QK+3FueZIYJoCZXZOH+K1MDxO AxFGd2scXNTXL1XeUtMtMlwbcW6e91KQZE0Nc+T4tcL0fdsHcfi5Ny+BrPXmkuSAZ8dk QjRg== X-Gm-Message-State: APjAAAWGBIj+GwOQRblSYgTUs6tyxAhJYw4W/36/WyomudCS30unWreb 0SJ0V90NGXgqPMIxmVT6/CkYeg== X-Google-Smtp-Source: APXvYqzV0e6T0rs2m+MRUpdDoDvQEgMELLCDAbEB1OLJYYp6qcptR/b/IAcWJlL79BFju+yMVVfNpw== X-Received: by 2002:a1f:2dcf:: with SMTP id t198mr9913263vkt.27.1560181155738; Mon, 10 Jun 2019 08:39:15 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id v185sm2858615vkf.51.2019.06.10.08.39.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 08:39:14 -0700 (PDT) Date: Mon, 10 Jun 2019 11:39:14 -0400 From: Shawn Webb To: Bruce Evans Cc: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org Subject: Re: svn commit: r348843 - head/sys/vm Message-ID: <20190610153914.o2n5yjgfu3ubzbbt@mutt-hbsd> References: <201906100307.x5A37BFt099669@repo.freebsd.org> <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> <20190611010531.A3253@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lbusykrf4wkrwufc" Content-Disposition: inline In-Reply-To: <20190611010531.A3253@besplex.bde.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: A3E1780482 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.991,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2019 15:39:17 -0000 --lbusykrf4wkrwufc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 11, 2019 at 01:33:23AM +1000, Bruce Evans wrote: > On Mon, 10 Jun 2019, Shawn Webb wrote: >=20 > > On Mon, Jun 10, 2019 at 03:07:11AM +0000, Doug Moore wrote: > > > ... > > > Log: > > > There are times when a len=3D=3D0 parameter to mmap is okay. But on= a > > > 32-bit machine, a len parameter just a few bytes short of 4G, round= ed > > > 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 +=3D pageoff; /* low end... */ > > > - size =3D (vm_size_t) round_page(size); /* hi end */ > > > + /* Check for rounding up to zero. */ > > > + if (round_page(size) < size) > > > + return (EINVAL); > >=20 > > The mmap(2) manpage says that len=3D=3D0 results in EINVAL, so the manp= age > > needs updating. >=20 > The man page doesn't say that only len =3D=3D 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=3D=3D0. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --lbusykrf4wkrwufc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAlz+eZ0ACgkQ/y5nonf4 4foGeg//ZvKETORITTUsmr6yvKYO8iaX5VhaH+XVcfGBdNtOUzrTSV7SkkSQHhAc 5GwH9QEjjWC2+auZjzMuaDMhXGsvAmCcEleHjUmrEDJOeshobVAUkAv8knAyCsRR NtBF55dBnI+xceCXZ3X24OUdDPlyod29cDHdcE/oQhogYspegk/IGHJfqNARH7qj 8NlOa0ZvjkpaKxn7PAXecZDqt9Yi6A8bh1pOxdJ1IloVx3KeI7Bb9LaLueS8Vmmj YPh5FYiLyJ53BReYySZyvYdpSor7GwijVFILND3JT4t4tiD3VuAtxLh1WBgrf4mp rWOPNgNH8Phz1/HnGoGE9fv3SArGqmLW/FRQZXH4T4FhHhyztqjok6yT/5DDNLbf WPYtfAGVf/+01HrYn0Zjr+uqSkJHjpQnTJDqih/hRx91YI0rukmmvJ+ab9+51zJV 3fmdBS3mmKP+5IM98dZGsFRuF0T1SyDAkFDJ+qojd3VZscTVCNcIFdIvNyeg4f+0 e1I0CzZJNpGxyX4wVO7Wp76A8Ju7vmBpxYfWk9ZKb6dZbYtOal/im1mqM0ljn7Oe kfNjI07ZJLxbQ3brtB8Gew30j9GWSl54+ZVoM4xLeu6Sr9l8v51dr0XtzYHcYgO8 /pvfAOm31nY+yEGBeUiFchrMTWhFIXvLgMQxq5l1u90kHfCzWso= =yRer -----END PGP SIGNATURE----- --lbusykrf4wkrwufc--