From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202610 header.b=sXKS7hYG; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id BC2865A0271 for ; Tue, 06 Oct 2026 04:49:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202610; t=1791254954; bh=pywJwG/Tm3UmA5QjkZqzcdPCrW+2dEhse3Wd7oXniJY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sXKS7hYGzEU4Tb8CT7b6utd04mB6vJ1JNj7f/kRh5sEgjyTjSEVQMT9K/WS7iwjH6 SLQBhRKp0Hqx3KmkjMF399E2AEhLiEFCfZATFJhetIPUl08f9eBU/uH6O1kgckhxSu K8D7BQsEfm2OD59HEBB45DuJdT5bGYvEyNeSYnqcbD5Tc2r5yrDNmiSIYgRI/GGYSO 7ouExnErBLiyolYWdXA9XxXJZZ/UHHBcz8mtdTH3lFQthbGs/NqITqLOzdnWtx4Ilo Wd7IHFm+SNHJaJzrNtAd06ZtyKhHC5OnmGmKZXs9VmK9j2B0o5itzQ3yce5pfIxb+9 J3csBDbeIB3Sg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4hzLLf58KNz4wJH; Tue, 06 Oct 2026 13:49:14 +1100 (AEDT) Date: Tue, 6 Oct 2026 13:49:08 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] util: Make setting uidmap and gidmap errors non-fatal Message-ID: References: <20261002070050.2065232-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MVnwNosizHND4Dzw" Content-Disposition: inline In-Reply-To: <20261002070050.2065232-1-sbrivio@redhat.com> Message-ID-Hash: GCGKKB3TKFKD4RVI6XI6QR76GTRZAYT4 X-Message-ID-Hash: GCGKKB3TKFKD4RVI6XI6QR76GTRZAYT4 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --MVnwNosizHND4Dzw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 02, 2026 at 09:00:50AM +0200, Stefano Brivio wrote: > Starting from commit 7bf1595c9242 ("isolation: Don't create our userns > as nobody"), we unconditionally set uidmap and gidmap in the detached > user namespace. >=20 > If passt is started from a detached PID namespace, but /proc hasn't > been remounted to reflect this, we'll fail to write those entries. >=20 > That's actually fine as uidmap and gidmap are something that, strictly > speaking, we only need to write in pasta mode when a command is > detached (it's now done in all cases for simplicity). >=20 > Warn, because it's not the expected behaviour (/proc should probably > be remounted first), but don't fail on that. >=20 > Link: https://github.com/containers/crun/issues/2283 > Suggested-by: David Gibson > Signed-off-by: Stefano Brivio Since this can now fail non-fatally, I'd suggest adding a return code to make_ugid_map(). The caller (create_userns()) should probably die() if it fails when we're actually changing UID/GID. > --- > util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/util.c b/util.c > index c02aea9..ff1f19f 100644 > --- a/util.c > +++ b/util.c > @@ -1147,5 +1147,5 @@ void make_ugid_map(pid_t pid, uid_t uid, gid_t gid) > if (write_file(uidmap_path, uidmap) || > write_file(setgroups_path, "deny") || > write_file(gidmap_path, gidmap)) > - die("Couldn't configure user mappings"); > + warn("Couldn't configure user mappings"); > } > --=20 > 2.43.0 >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --MVnwNosizHND4Dzw Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIyBAABCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmrEYZsACgkQzQJF27ox 2GdE2g/4k9EJtmAoZpwQAk2xLBvSJvL+IccaxQyOturnxL9KMyTWFQxu4n5QrKwA RA2Lmls0V93tCNZnGiXu2/ZVzh7fjDrnoL/f4m5lununDzpGwXKWj40W7+smF8jd p0H8X7yhxKrsWGlNR7RYVkPkxWr+Q7XBDeuEf+IbglPnEevCNC7AbozZh+ILgX8w kt+Vg9vaeXxKODn7NwBW5hG9/Sj0THQq57gVBrn3YE5bO7rIb4Y2Dwp9dfQB4nil TbGE9VQr0G0okqzDZlHt5hmrP9566+hxP5YZEcYNAHnmrR3WbRgrSollpBhQUgyc vkuCJm9ko+zLoI2uKvIBGhkwTi08TUMXJe6Qqv4v3MWuuC45RA9oCsNvSMTnCYWt NmzN7GWyv7R87S3FXvtzTPx7hIovjoKb+GMGZHZz9vo9chAUtvGo7EK4VlcX5Iuf LPhnSiIm1Dv8ZvnGVxs7841Glg20eGPy1WwOJClIGkcu/HojNn9hRQq+Up/GYMyI XL2Tkhw3kj074++XE3WyOoc/1L6/2NleNxde6eQyh05ZC2uGBSCurJXr04kNEPqm zQgCnRs+XaPR2HQ/gMYzwd+rLCiER33dngGJt+RfCMCkv4qRpxSnA6mwOIGvi9PP E5LEVbkqCYgG04Gl/iFffGt0J4UQ1PidZv9e7E8BKa7azv9vzQ== =7qWV -----END PGP SIGNATURE----- --MVnwNosizHND4Dzw--