Date: Mon, 2 Nov 2020 22:49:07 +0100 From: Emmanuel Vadot <manu@bidouilliste.com> To: Stefan Esser <se@freebsd.org> Cc: Oliver Pinter <oliver.pntr@gmail.com>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, 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> <CAPjTQNGoy_%2BNc=VvbC=9oNOf_FG4oM0XNaHv%2Bq5oDsvpngSUOQ@mail.gmail.com> <338fdfbb-6fad-0e44-5df6-b5a1c38d3e4f@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2 Nov 2020 22:41:38 +0100 Stefan Esser <se@freebsd.org> wrote: > Am 02.11.20 um 20:20 schrieb Oliver Pinter:> On Monday, November 2,=20 > 2020, Stefan E=DFer <se@freebsd.org > > <mailto:se@freebsd.org>> wrote: > >=20 > > Author: se > > Date: Mon Nov=A0 2 18:48:06 2020 > > New Revision: 367280 > > URL: https://svnweb.freebsd.org/changeset/base/367280 > > <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 <manu@bidouilliste.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201102224907.401c9200dffba42cab827b2d>