From nobody Tue Aug 29 19:36:06 2023 X-Original-To: current@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 4RZyMt2Lmgz4s6qR for ; Tue, 29 Aug 2023 19:36:10 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZyMs3J1Xz4ZbV for ; Tue, 29 Aug 2023 19:36:09 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b="Z/teXHma"; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::d2f as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org; dmarc=none Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7927f24140eso155925839f.2 for ; Tue, 29 Aug 2023 12:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1693337768; x=1693942568; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=KcnKMa5Eo6cOUalj9T5LWji6iFUSu16Re0I3Vpc/DYA=; b=Z/teXHmaG6UMVJhj+Cr6zQiDlOKQ+9EZhqFavEBeiQauGJ90gdDHdHqISteoq08ejs WBhU6z2A3KHsp4BaHhAFVdJJ5DUxaDYrQ+mNVXhz07a8i+uiGPDrUijD6dK0omFTlijx jCFEHnXQhvn72RPt6FCX9UtaPlSh1g9TIl0AskuHI8OetJI0dXXzX/IvD0zE9EkVoEpF ZQ1mYdWYxDbYUAGKOBhsviQosKGtQrP3dX25JcGM1uR43SO7pQP3AmT9RcUM88N8fP9z 0h0z3qlmkVa1F485D7yIPHexglRuQi5Efqep3psZaaGOVz87IZY6uMPxwf/Yokg1vQLQ m+nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693337768; x=1693942568; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KcnKMa5Eo6cOUalj9T5LWji6iFUSu16Re0I3Vpc/DYA=; b=Iv4tWx9rkHhg/N1aCsySuUbB89jreqokY9hpPxL14hSq/sfOCIYUmbu/EjS0N07IEo 4nnB+gfbAH8ivgCbUqdEIqiRGJAUi+QVWTqy8pyOCrkeXPZ79FLFv8dyOePgFR3PoYl6 JVf5aUqNqxFGjWygzuXJXGs45v48LlOgDVawJ2mEXV5rQPfdKznMHWzfwimAUBOBWS8R jiHEpSCFSFbLxJkWp9AGB89PL1GtBFJkb5SUSOJ1DsHuSjIixbLin/SafuIECmmdy/XZ OOaCVr+LszoX0XNPbgct4Z9eyfCQVgjQ4RBCcoFJSlra604/gKtlCSLj7kIe8SkgSImG 2jmg== X-Gm-Message-State: AOJu0YwD2fLSJmYfndHhgLYNioRc4zAB8PhwM7PxPoQPLITVZVlj5kub GexTRNBMQzxY5x+pSA0765wM/7yZhhhg/HRdh4fQSXRE8o0rBy6itWyb17GtPOhJrqHlzBsXKUe lrlmthlP5Qre6Xnltakt48FnCgicaCJSjAPbzDXmni8cLokrMv4T87Pq6WXj0klfH/PAoN20UEF N2Th8H X-Google-Smtp-Source: AGHT+IEMWmorNfAk7XI3njl4ecOYI0PzD3U072SAdaSdFWQWYxYZPxgx6ZE4LaUEPYAVV3wz1FU76Q== X-Received: by 2002:a92:d90c:0:b0:346:d51:9922 with SMTP id s12-20020a92d90c000000b003460d519922mr332217iln.13.1693337768294; Tue, 29 Aug 2023 12:36:08 -0700 (PDT) Received: from mutt-hbsd ([73.153.118.59]) by smtp.gmail.com with ESMTPSA id 1-20020a0566380a4100b0042b2df337ccsm3183095jap.76.2023.08.29.12.36.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 12:36:07 -0700 (PDT) Date: Tue, 29 Aug 2023 15:36:06 -0400 From: Shawn Webb To: current@freebsd.org Subject: Re: Possible issue with linux xattr support? Message-ID: <20230829193606.ub4sqqpsyah47brg@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-ALPHA2-HBSD FreeBSD 14.0--HBSD amd64 1400096 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <20230829190258.uc67572553e4fq3v@mutt-hbsd> <20230829192516.jb2t65sp5rdlysss@mutt-hbsd> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="n7spl4be23jygaoi" Content-Disposition: inline In-Reply-To: X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.10 / 15.00]; SIGNED_PGP(-2.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MID_RHS_NOT_FQDN(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[current@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d2f:from]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[current@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4RZyMs3J1Xz4ZbV --n7spl4be23jygaoi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 29, 2023 at 09:31:46PM +0200, Felix Palmen wrote: > * Shawn Webb [20230829 15:25]: > > On Tue, Aug 29, 2023 at 09:15:03PM +0200, Felix Palmen wrote: > > > * Kyle Evans [20230829 14:07]: > > > > On 8/29/23 14:02, Shawn Webb wrote: > > > > > Back in 2019, I had a similar issue: I needed access to be able to > > > > > read/write to the system extended attribute namespace from within= a > > > > > jailed context. I wrote a rather simple patch that provides that > > > > > support on a per-jail basis: > > > > >=20 > > > > > https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/96c8= 5982b45e44a6105664c7068a92d0a61da2a3 > > > > >=20 > > > > > Hopefully that's useful to someone. > > > > >=20 > > > > > Thanks, > > > > >=20 > > > >=20 > > > > FWIW (which likely isn't much), I like this approach much better; i= t makes > > > > more sense to me that it's a feature controlled by the creator of t= he jail > > > > and not one allowed just by using a compat ABI within a jail. > > >=20 > > > Well, a typical GNU userland won't work in a jail without this, that's > > > what I know now. But I'm certainly with you, it doesn't feel logical > > > that a Linux binary can do something in a jail a FreeBSD binary can't. > > >=20 > > > So, indeed, making it a jail option sounds better. > > >=20 > > > Unless, bringing back a question raised earlier in this thread: What's > > > the reason to restrict this in a jailed context in the first place? I= OW, > > > could it just be allowed unconditionally? > >=20 > > In HardenedBSD's case, since we use filesystem extended attributes to > > toggle exploit mitigations on a per-application basis, there's now a > > conceptual security boundary between the host and the jail. > >=20 > > Should the jail and the host share resources, like executables, a > > jailed process could toggle an exploit mitigation, and the toggle > > would bubble up to the host. So the next time the host executed > > /shared/app/executable/here, the security posture of the host would be > > affected. >=20 > Isn't the sane approach here *not* to share any executables with a jail > other than via a read-only nullfs mount? I thought about that, too, but nullfs is not guaranteed to be available or applicable in all environments. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --n7spl4be23jygaoi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmTuSKAACgkQ/y5nonf4 4fqOMxAAmCBZusX2my38z9cqfCanWLPWFhOG8ocXB6zUGNr5wgv4orQk8SqxwQdU IDwhsMQTxYY12yCYlpfKIM2HXyjB78Fmp2lLJAnszczsnECb9k1Q9OHV1QylwsQ9 7D/T2FBODIY8LdmS79x4jzNGAsEyd1BJpHMgjSFxK0a80McpWV7XJd6nXxPdSnqF ZM/x/WTCcxzsis5SuOeSswZwmpADDLC8RbiVFrSWR7ZOxdAzQbr58As+uzptpI5z A/OdGX1LNppial8KMJii9kxkvj+mZfdamIXfk1KNisZJAGzfb1IyAX9BIWhLSId5 aHZfNU2m2OYLcqOg30rIARvTRFMPhlp8RXZZoxJjglpmpH8Eq10/b5Z9nO8DER2Q H08Gb9bkdfzCqpXOKPY5+MP9OBFYxUIZFc2wp0qyquEEoZc+3rbaKK0A/5w2rjTa AoygED6oL2kKifMG98+sPduFFw29sDEE/4D2HaRKBJlTcftG0+ByPu/UOFSxpBxC 88UCX6p3LyLUT/gwXMXI0nrlEAqXFzxBdUkrUi+e6v5cMaH6PVVhVHkv9Xsz2g0p EzY+6OmSWX/BP66gsGj9MUb9rmOHc2m3ZurP0sKdiQ8c0jcF/+e7n4Kw3b1SLvYk 6AIFaBw3yirarAeo7hsWGC4jvwUZiwlJAEvnxZDcc+eSOsdFkZI= =J0gA -----END PGP SIGNATURE----- --n7spl4be23jygaoi--