From owner-svn-src-all@freebsd.org Mon Nov 2 21:49:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4567645C1B2; Mon, 2 Nov 2020 21:49:19 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CQ64s6C9sz446m; Mon, 2 Nov 2020 21:49:17 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1604353748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L1YOR3BwUVFXqLIqzFYY0D73qpp76uHgDerLkkFw3lQ=; b=SabmnV5Q2zB5pvGXg13H5P4qjizXjZ942hlL5vCB3L41OUJuLWCzY1L4s/GN07JTeSOvuv HxaePyYlzT97NH2YYim7VJWe8P3F8foGcQl16Ym+USKr5JCZ9YBcFbCt3EcNU0O9gwbUu2 VrIB1MM0lgwOoV2vQaAHJzGCw1xvCRA= Received: from amy.home (lfbn-idf2-1-288-247.w82-123.abo.wanadoo.fr [82.123.126.247]) by mx.blih.net (OpenSMTPD) with ESMTPSA id d2d4687a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 2 Nov 2020 21:49:07 +0000 (UTC) Date: Mon, 2 Nov 2020 22:49:07 +0100 From: Emmanuel Vadot To: Stefan Esser Cc: Oliver Pinter , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r367280 - head/lib/libc/gen Message-Id: <20201102224907.401c9200dffba42cab827b2d@bidouilliste.com> In-Reply-To: <338fdfbb-6fad-0e44-5df6-b5a1c38d3e4f@freebsd.org> References: <202011021848.0A2Im7Kx098921@repo.freebsd.org> <338fdfbb-6fad-0e44-5df6-b5a1c38d3e4f@freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4CQ64s6C9sz446m X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=SabmnV5Q; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-2.79 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.02)[-1.022]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.24)[-0.243]; NEURAL_HAM_MEDIUM(-1.03)[-1.029]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2020 21:49:19 -0000 On Mon, 2 Nov 2020 22:41:38 +0100 Stefan Esser wrote: > Am 02.11.20 um 20:20 schrieb Oliver Pinter:> On Monday, November 2,=20 > 2020, Stefan E=DFer > > wrote: > >=20 > > Author: se > > Date: Mon Nov=A0 2 18:48:06 2020 > > New Revision: 367280 > > URL: https://svnweb.freebsd.org/changeset/base/367280 > > > >=20 > > Log: > > =A0 Re-arrange some of the code to separate writable user tree > > variables from > > =A0 R/O variables. > >=20 > > =A0 While here fix some nearby style. No functional change intende= d. > >=20 > > =A0 MFC after:=A0 =A0 1 month > >=20 > >=20 > > Is there any phabricator reference for this / these commit(s) + reviewe= r=20 > > lists? >=20 > The previous commit that has been refined in this one has been > discussed in D27009. >=20 > I had added the new R/W sysctl variable to a switch statement that > contained one R/O string value, and excluded the OID from causing > an error return when a new value had been passed. >=20 > This was functionally OK, but I have decided to move handling of > the new writable variable to before the check for a write attempt > and thus need to test specifically for its OID. >=20 > This sysctl variable is referenced in Scott Longs proposed > getlocalbase() function (D27022), but also in the change to make > it define defaults paths in /etc/defaults/rc.conf (D27014). >=20 > I do not support to make LOCALBASE dynamic for a broad range of > programs, since this could lead to severe security issues (e.g. > when a program is restricted by policy settings LOCALBASE/etc and > an user-defined LOCALBASE could be used to circumvent them. >=20 > There are already programs that respect a LOCALBASE environment > variable, e.g. the pkg program, to allow it to e.g. operate with > a DESTDIR prefix other than "/". This is a program that could > instead use getlocalbase(), IMHO. >=20 > But for security reasons all files that determine policies and > exist in LOCALBASE since they are not distributed as part of the > base system, should be located in a secure way, and that is by > referring to a compiled in trusted path, IMHO. >=20 > Even if the sysctl variable "user.localbase" can only be written to > by root, the use of getlocalbase() provided by a shared library could > allow to perform a LD_PRELOAD attack (provide a getlocalbase() that > leadsto a user provided policy file instead of the admin controlled > one). >=20 > Regards, STefan I think that the first question we want to ask is : Do we want to support LOCALBASE being different than /usr/local I honestly don't see any advantages of making it !=3D/usr/local/ and before we start putting a lot of new/useless(for I guess 99% of our user base) in the tree we should here why people are using /usr/pkg or whatever weird location. If they have some good argument, then we should proceed further. --=20 Emmanuel Vadot