Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Nov 2021 19:02:33 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
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>
In-Reply-To: <YZV8euPb043EMws9@kib.kiev.ua>
References:  <202111172022.1AHKM3IJ059209@gitrepo.freebsd.org> <YZV8euPb043EMws9@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <brooks@FreeBSD.org>
> > AuthorDate: 2021-11-17 20:12:21 +0000
> > Commit:     Brooks Davis <brooks@FreeBSD.org>
> > 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20211118190233.GH81740>