From nobody Wed Aug 30 20:00:13 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 4RbZsM6PFJz4sRHZ for ; Wed, 30 Aug 2023 20:00:23 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (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 4RbZsL6YLsz4Ldh; Wed, 30 Aug 2023 20:00:22 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of dchagin@heemeyer.club has no SPF policy when checking 195.93.173.158) smtp.mailfrom=dchagin@heemeyer.club; dmarc=none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.2/8.16.1) with ESMTP id 37UK0EeC012989; Wed, 30 Aug 2023 23:00:14 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.2/8.16.1/Submit) id 37UK0D0o012988; Wed, 30 Aug 2023 23:00:13 +0300 (MSK) (envelope-from dchagin) Date: Wed, 30 Aug 2023 23:00:13 +0300 From: Dmitry Chagin To: Kyle Evans Cc: Shawn Webb , current@freebsd.org, Alexander Leidinger Subject: Re: Possible issue with linux xattr support? Message-ID: References: <20230829190258.uc67572553e4fq3v@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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: / X-Spamd-Result: default: False [-0.73 / 15.00]; AUTH_NA(1.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.93)[-0.931]; FORGED_SENDER(0.30)[dchagin@freebsd.org,dchagin@heemeyer.club]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU]; MLMMJ_DEST(0.00)[current@freebsd.org]; R_SPF_NA(0.00)[no SPF record]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[dchagin]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[dchagin@freebsd.org,dchagin@heemeyer.club]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4RbZsL6YLsz4Ldh On Tue, Aug 29, 2023 at 02:07:11PM -0500, Kyle Evans wrote: > On 8/29/23 14:02, Shawn Webb wrote: > > On Tue, Aug 29, 2023 at 05:45:51PM +0300, Dmitry Chagin wrote: > > > On Tue, Aug 29, 2023 at 12:59:11PM +0200, Felix Palmen wrote: > > > > * Dmitry Chagin [20230828 18:57]: > > > > > On Mon, Aug 28, 2023 at 08:03:33AM +0200, Felix Palmen wrote: > > > > > > * Cy Schubert [20230827 16:59]: > > > > > > > > > > > > > > If we are to break it to fix a problem, maybe a sysctl to enable/disable then? > > > > > > > > > > > > IMHO depends on the exact nature of the problem. If it's confirmed that > > > > > > it (always and only) breaks for jailed processes, just disabling it for > > > > > > them would be the better workaround. "No-op" calls won't break anything. > > > > > > > > > > > > > > > > please, try: https://people.freebsd.org/~dchagin/xattrerror.patch > > > > > > > > Thanks, I can confirm this avoids the issue in both cases I experienced > > > > (install from GNU coreutils and python). > > > > > > > thanks, this is the first half of the fix, it works for you due to you > > > are running tools under unprivileged user, afaiu. The second I have > > > tested by myself :) > > > > > > > If I understand this patch correctly, it completely avoids EPERM, > > > > masking it as not supported, so callers should consider it non-fatal, > > > > allowing to silently ignore writing of "system" attributes while still > > > > keeping other functionality? > > > > > > > system namespace is accessible only for privileged user, for others Linux > > > returns ENOTSUP. So many tools ignores this error, eg ls. > > > > > > the second: https://people.freebsd.org/~dchagin/sea_jailed.patch > > > > > > Try this under privileged user, please. > > > > 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: > > > > https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/96c85982b45e44a6105664c7068a92d0a61da2a3 > > > > Hopefully that's useful to someone. > > > > Thanks, > > > > FWIW (which likely isn't much), I like this approach much better; it makes > more sense to me that it's a feature controlled by the creator of the jail > and not one allowed just by using a compat ABI within a jail. > Seems phab mail is dead, https://reviews.freebsd.org/D41643