From nobody Thu Jul 21 14:01:30 2022 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 4LpZ4L075wz4Wj6d; Thu, 21 Jul 2022 14:01:38 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from tor1-11.mx.scaleengine.net (tor1-11.mx.scaleengine.net [IPv6:2001:470:1:474::25]) (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 4LpZ4K1ly7z434g; Thu, 21 Jul 2022 14:01:37 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.3] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by tor1-11.mx.scaleengine.net (Postfix) with ESMTPSA id 12EAC39443; Thu, 21 Jul 2022 14:01:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 tor1-11.mx.scaleengine.net 12EAC39443 Message-ID: <6505b9bd-0777-0008-fa62-e56c76033c7f@freebsd.org> Date: Thu, 21 Jul 2022 10:01:30 -0400 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 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: git: 4e2121c10afc - main - mac_ddb: add some validation functions Content-Language: en-US To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202207182206.26IM6vMQ048237@gitrepo.freebsd.org> From: Allan Jude In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4LpZ4K1ly7z434g X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 2001:470:1:474::25 is neither permitted nor denied by domain of allanjude@freebsd.org) smtp.mailfrom=allanjude@freebsd.org X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[allanjude]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 7/19/2022 10:26 AM, Konstantin Belousov wrote: > On Mon, Jul 18, 2022 at 10:06:57PM +0000, Allan Jude wrote: >> The branch main has been updated by allanjude: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=4e2121c10afc3d9273368eae776fe31d0c68ba6a >> >> commit 4e2121c10afc3d9273368eae776fe31d0c68ba6a >> Author: Mitchell Horne >> AuthorDate: 2022-07-18 21:25:00 +0000 >> Commit: Allan Jude >> CommitDate: 2022-07-18 22:06:22 +0000 >> >> mac_ddb: add some validation functions >> >> These global objects are easy to validate, so provide the helper >> functions to do so and include these commands in the allow lists. >> >> Reviewed by: markj >> Sponsored by: Juniper Networks, Inc. >> Sponsored by: Klara, Inc. >> Differential Revision: https://reviews.freebsd.org/D35372 >> --- >> sys/security/mac_ddb/mac_ddb.c | 101 +++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 101 insertions(+) > >> +static int >> +db_show_vnet_valid(db_expr_t addr, bool have_addr, db_expr_t count, char *modif) >> +{ >> + VNET_ITERATOR_DECL(vnet); >> + >> + if (!have_addr) >> + return (0); >> + >> + VNET_FOREACH(vnet) { >> + if ((void *)vnet == (void *)addr) >> + return (0); >> + } >> + >> + return (EACCES); >> +} > > This seems to break non-VNET builds: > /usr/home/kostik/work/DEV/src/sys/security/mac_ddb/mac_ddb.c:200:15: error: use of undeclared identifier 'vnet'; did you mean 'int'? > if ((void *)vnet == (void *)addr) > ^~~~ > int > /usr/home/kostik/work/DEV/src/sys/security/mac_ddb/mac_ddb.c:200:15: error: expected expression > 2 errors generated. > --- mac_ddb.o --- > *** [mac_ddb.o] Error code 1 I reached out to Mitchell, but he hasn't gotten back to me yet (he is on vacation), so I've committed a fix. -- Allan Jude