From nobody Wed Nov 17 22:04:42 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 CE19B18A0A81; Wed, 17 Nov 2021 22:04:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HvcRQ2hXDz4jnf; Wed, 17 Nov 2021 22:04:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 1AHM4g2x042133 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 18 Nov 2021 00:04:46 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 1AHM4g2x042133 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 1AHM4gYj042131; Thu, 18 Nov 2021 00:04:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Nov 2021 00:04:42 +0200 From: Konstantin Belousov To: Brooks Davis 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: 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202111172022.1AHKM3IJ059209@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HvcRQ2hXDz4jnf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N 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 > AuthorDate: 2021-11-17 20:12:21 +0000 > Commit: Brooks Davis > 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.