From nobody Thu Nov 18 19:02:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 975C31856481; Thu, 18 Nov 2021 19:02:34 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hw8Lf3RQWz3mgb; Thu, 18 Nov 2021 19:02:34 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id D5F0C3C0199; Thu, 18 Nov 2021 19:02:33 +0000 (UTC) Date: Thu, 18 Nov 2021 19:02:33 +0000 From: Brooks Davis To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: b7fd86118fb5 - main - syscalls: sprinkle in const values Message-ID: <20211118190233.GH81740@spindle.one-eyed-alien.net> References: <202111172022.1AHKM3IJ059209@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kA1LkgxZ0NN7Mz3A" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4Hw8Lf3RQWz3mgb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --kA1LkgxZ0NN7Mz3A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 18, 2021 at 12:04:42AM +0200, Konstantin Belousov wrote: > On Wed, Nov 17, 2021 at 08:22:03PM +0000, Brooks Davis wrote: > > The branch main has been updated by brooks: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db7fd86118fb5d41f61fdfa00= 3d11e9367770ff0a > >=20 > > commit b7fd86118fb5d41f61fdfa003d11e9367770ff0a > > Author: Brooks Davis > > AuthorDate: 2021-11-17 20:12:21 +0000 > > Commit: Brooks Davis > > CommitDate: 2021-11-17 20:12:21 +0000 > >=20 > > syscalls: sprinkle in const values > > =20 > > Add missing const qualifiers to a number of syscall arguments. > > =20 > > Obtained from: CheriBSD > > =20 > > Reviewed by: kevans > > --- > > sys/kern/syscalls.master | 32 ++++++++++++------------ > > sys/kern/systrace_args.c | 64 ++++++++++++++++++++++++----------------= -------- > > sys/kern/vfs_syscalls.c | 10 ++++---- > > sys/sys/syscallsubr.h | 13 +++++----- > > sys/sys/sysproto.h | 32 ++++++++++++------------ > :( >=20 > > @@ -501,7 +501,7 @@ > > } > > 74 AUE_MPROTECT STD|CAPENABLED { > > int mprotect( > > - _In_ void *addr, > > + _In_ const void *addr, > > size_t len, > > int prot > > ); > You did not marked addr for munmap(2) as const, but did this for mprotect= (2). > I believe that this is the right interpretation for munmap, but not for > mprotect due to PROT_NONE. >=20 > Or at least it should be consistent WRT allowed side effects on access. >=20 Thanks for pointing this out. It's definitly an error as the signature of mprotect() does include const. I'm not sure why I made this change several years ago. I'll revert it. -- Brooks --kA1LkgxZ0NN7Mz3A Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJhlqNJAAoJEKzQXbSebgfAjC0H/iaOKbMSgsklWtO2EGxx/gRH vyGar1QSZC7B3wB18VLp6Z4Thu2GfYz/b60iNXBumq8Uq/xiASkPSN3umXywFrnu ZfG6/aRZWR8tA24YNeU7QhZshy7dE9URPQ/MtlhQ8bu10Ukb7rIhF8sToJZcC7dp V6vdSBNVUQ7nD48AcStlKZ0TJYION1mBnDTtNKLzQOzRP0pLm5EGqnom0ndBuvoB d0H/VL+Os8x2zWiFAHVRTY5qZ8nB8/hDR/KaJIMncfoygF+vnyF4YTZuzV0zoP22 udAgeUY9wZLmP0gq3QmTrx5CTs1CMAZwZYzNO0oNHhWwCy9O+rKHwWrOYHs0uUI= =9bAj -----END PGP SIGNATURE----- --kA1LkgxZ0NN7Mz3A--