From nobody Tue Aug 29 19:07:11 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 4RZxkX0GKxz4s5lP for ; Tue, 29 Aug 2023 19:07:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZxkW6sxyz4SjC; Tue, 29 Aug 2023 19:07:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693336036; 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=D1PpuNUhZxOUcCo3rRS/QVEhUZN+nm0nxJ0J54bIh50=; b=pBeK2pZQSp3cvWwvjVbS2WKAf4T4iAZQEaBze3Pu0b1JPHbK60fUsw+BvKuMknF2Novj6/ qjsMK2iyUUzx1VWZPBhVmZsSszN4vK0QRplstc8up/7z4lXij0Z9x9keYNiMjQpZHeimgI MsNhEp0aARrsrnoC8FV4wnyOLoboDyhM5oun4I3I8J0Dml1rwroi9ip6i5NCwIg7WU1+H8 uAnsPLqX662JQL5ccAPnxm0z6YDX21oslT5w8ZE3SnxjMoPjElq5G2mdtUBRbYCxbGyOmh sxgV3Zjtx4Ry1jx+hI67I99IJbMev4Zh7PYy1hAUN6WN5+Gkc0OIlNI/hwlxBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693336036; a=rsa-sha256; cv=none; b=ldA15mHO8VolQn1BtJ5GUa2aOL+MvrUXY67/7B8StFMz8Bomz94aW+KbNESErj1LQpL+1T sSjmL1PffPQCuyEggvWxrfWUAa4MfP3joIjCdmjLiIyr6CwpIyfydUp1mmb0fwsBig8ZLr lU8qLirA1USjbHiJJF1CEXtCa4s4UoA4Njlx3OSl0yY+Kp7qIOxXBjyRRLG8zYqx1z+/7p pLNgMtS2GSXVd+dDu/indvvwNGJLdAjrRCmiKSE7/ZILtZAPtNlSckUGj/7BMQpt60rMPs pxpIkqpzdtKgOeIncZJ+2xHBA4pAJfHzpm6wIYeE4Hpoj5UEPS/0fnYYpIF3Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693336036; 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=D1PpuNUhZxOUcCo3rRS/QVEhUZN+nm0nxJ0J54bIh50=; b=Dm8zbUx8XUt/LqkrmVCB8DuEWwumMGBWOKPqk7VExQi98wqbCja6dZN1PkZPzAMhkGo3VG mjeuHradfALDrD4imSPZQtCKOMULG4VeVHoSfD8eGlD54pApwxWyJt0DXXrjZaiqj+nDKb PvpXCjhYUTk3CePozVLKfWYBb90w41Aq7UX0/VXO93joWz2BI28R16BTgOUWNFdrZWNCe6 vx1UVLBDdgMbVzHWbGRRK1gXhlMKSy0RgmWhaIQri2+Tz2gjdXCFhWeKE+E0AwzmvBHMZS yHPogcjeT9JcGQ78nNzvBQakUB/N+qH67Nl0Qm2Pfjzrw8e0KSCwptehEYzkXw== Received: from [10.9.4.95] (unknown [209.182.120.176]) (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 did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RZxkW3MSKz18Tg; Tue, 29 Aug 2023 19:07:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Tue, 29 Aug 2023 14:07:11 -0500 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Possible issue with linux xattr support? To: Shawn Webb , Dmitry Chagin Cc: current@freebsd.org References: <3q2k3tje2ig2s6wzy4hzvjmoyejiecminvcvevivumtukxrgki@btnpjbztyfa6> <20230829190258.uc67572553e4fq3v@mutt-hbsd> Content-Language: en-US From: Kyle Evans In-Reply-To: <20230829190258.uc67572553e4fq3v@mutt-hbsd> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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. Thanks, Kyle Evans