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>

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

[-- Attachment #1 --]
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:
> > 
> > URL: https://cgit.FreeBSD.org/src/commit/?id=b7fd86118fb5d41f61fdfa003d11e9367770ff0a
> > 
> > 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
> > 
> >     syscalls: sprinkle in const values
> >     
> >     Add missing const qualifiers to a number of syscall arguments.
> >     
> >     Obtained from:  CheriBSD
> >     
> >     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 ++++++++++++------------
> :(
> 
> > @@ -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.
> 
> Or at least it should be consistent WRT allowed side effects on access.
> 

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



[-- Attachment #2 --]
-----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-----
help

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