Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp106288lqo; Tue, 7 May 2024 13:44:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWw196xX8K+T4awTr/+szZ0shBryuEuVbvZuhGMzmE5b46Adg93Rk69IffR4jlhnbJmzSOOgiSBS941gBc4QOnABgIzJvZWhtjo/rqjFQ== X-Google-Smtp-Source: AGHT+IELdBq7D6hAvXhlC0wgVTipJUmHioUSu+1DcigblV/1Q6sm1vTsekzmEwl3qZnFaSFk0U/f X-Received: by 2002:aa7:84c5:0:b0:6f3:f970:9f2a with SMTP id d2e1a72fcca58-6f49c21eae7mr853128b3a.10.1715114667720; Tue, 07 May 2024 13:44:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715114667; cv=pass; d=google.com; s=arc-20160816; b=R6yu4n386mst8N0ktCDy5rTwrTG3ffXFTuUd3P5r6E7pebcBYIU4najzlSzuaUCnut yB16ECeydnVO8cYQN3fpDkLTsnRQD+WkCZmzeEGaHx/t4Z72+DmigJrMYBnD7D4q0UyP DF3os3f0bFT1JvwnrqdrxghRa1JPLRGTmFKQteKl9GaH2cXfDiRr7aQXeqg1ZKWc2CVm JbLSlgblhNT5Nhmj4bwRDpoV+0zdnjIbxhgxDq0C6s1zb94qGnmQPPq4tFLa2IGLVWog naYY8A/zs9dxatPYCLMeFqnG1JuACWK0ObmJEgF6Mw7bK8Xh6U0R2/Bboi9IWpE8szew NMnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=vnCeIEbMK/S2Q+LWJU/37wK3PlXMM94h7g54EnTFDpw=; fh=H9cDCR8cq06RSIZH4HW0qJ886M9GbPHZVv/zny7p6RU=; b=y4MEI6wA9bc8wc+4myGB1Y3oHoBMR1aDv/U2XAXMP6GbeCMjjjzMJvvnapCI89uWnM 3RiFmzSApnZbFwaQX5Kht12WgvUfVML0FQ0Eq/Tju4v0gihAswi+N2cYIerva2BwouHT NxLg0Ne+wloHBAmnhi//ehYCL3TLj/XwYrND+kZw1LeCpi4wWX8d3tJK7suTJqUYDMkH At7WCKMdwB+E1pYNYxZA52h2FLZ2HcsHUKe19Gg8tEmrA+ishcj/TcYABaqRuAEAi/AS rkJlbEDOzVIrcctM/QEKaLEnI7UXkmeCUKPJ6l/W0eIfpmgmFM/aCfuoEFXlVxGPD9/1 ygiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amacapital-net.20230601.gappssmtp.com header.s=20230601 header.b=ikl29dlD; arc=pass (i=1 spf=pass spfdomain=amacapital.net dkim=pass dkdomain=amacapital-net.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-172154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172154-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v29-20020aa799dd000000b006f4468292d4si10067240pfi.261.2024.05.07.13.44.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 13:44:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20230601.gappssmtp.com header.s=20230601 header.b=ikl29dlD; arc=pass (i=1 spf=pass spfdomain=amacapital.net dkim=pass dkdomain=amacapital-net.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-172154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172154-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 50D8E287502 for ; Tue, 7 May 2024 20:39:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 297194205F; Tue, 7 May 2024 20:38:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amacapital-net.20230601.gappssmtp.com header.i=@amacapital-net.20230601.gappssmtp.com header.b="ikl29dlD" Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3C3A17D2 for ; Tue, 7 May 2024 20:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715114336; cv=none; b=r0m/Xg5uzJO5HpzYGuEK+uIoMq3SGRHoD4wfYcr6eXJFnMHAGJqeyyVo/otImkatwgCaPHOjxUEM3fQtuajivRhx0JPfaP9LoF7/x3ciA7d1Fyh/IgVm6cJm9upp9jT/Cn0NPF+34IYDQg8lrb7M4JKkyPvPmXRVXWBlMkkyuEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715114336; c=relaxed/simple; bh=Cd3CA+2L3RKB6jP4ss7YRlrKqmhPE6AGzn1nXgsUr10=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=EFlJ3LqUoqCokMQ6qBqKzCkFfCKa59q//NTIrjHK8qj4kIn6STgUc+0ELJZAuUZidO0v8SR+7QwC8XREJLv3tVjiaXJb6mSboTH/NWXzJ+mHpx7w/tAWXkG9isxJ0059CTcLNGxiY9GPf2EXpCJRr0HXon/0aYuHpI8DE1WEERY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=amacapital.net; spf=pass smtp.mailfrom=amacapital.net; dkim=pass (2048-bit key) header.d=amacapital-net.20230601.gappssmtp.com header.i=@amacapital-net.20230601.gappssmtp.com header.b=ikl29dlD; arc=none smtp.client-ip=209.85.221.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=amacapital.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amacapital.net Received: by mail-vk1-f181.google.com with SMTP id 71dfb90a1353d-4df1cb3c87eso1135928e0c.3 for ; Tue, 07 May 2024 13:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20230601.gappssmtp.com; s=20230601; t=1715114334; x=1715719134; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vnCeIEbMK/S2Q+LWJU/37wK3PlXMM94h7g54EnTFDpw=; b=ikl29dlDaKTt2cZteLe2jQcW0M+pN6/OvAIV8OnoeeLj0RDbcXwv4EUF7b0f4w8wLw AFzjFZrzDnpCNBkkmeY+Dn4jmRTPpVR+INy9jMUA8jkPJAfgI78po2/PhT0SdhsFSpRr FRGrbJq1r78i6e6ffKa9m5x/ilRD1lZ2KS+pGBQIbQGi/f1h8GZ0RcSkbpJo4HrP0HgL Y8l8/MBMgTgUJ3aZEqGTaX8IPtSthIkF4YHYuiCCIdGLogD8D/yCWPi7oZpXqHxTxYM5 0m3DoVXtfPr1nkiSMMZ6tp3wRryF9dnghf3CtPeezkKqrvtzOm35sKOH1hwBXcVKa4tU Iu7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715114334; x=1715719134; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vnCeIEbMK/S2Q+LWJU/37wK3PlXMM94h7g54EnTFDpw=; b=nA5lPtIyZ8BFK25ttSdRdeqcnLmPP+tIlTSp3xtQ8EvAFcRnJHYHcd/K4nNP3LGAwd Xgu+ESHDqRZ3gQpfA23AxLk4N23fmxEEsxM8tGfzSCuk26ue2ZMOvKlUaVL6/hp20uvV fGCoZrEAqG9XZxlJCT4r0Xe3EJRt60GQoMiR00mnmu8zgxwjo58HqMVuQtxZOFL/fLjQ CeNCKPHa2nuY91zlPKMhs1FQS23rllNG2yRlY2t4/KfvV4gcb/tUc+hftOVnWMPKPHg0 y271dznVQMU4bXEHdi7oqEPfTzoMVKt0TAQZVIvgbKZ3wdvwel+homTFywOrQEBSfj8d a2qQ== X-Forwarded-Encrypted: i=1; AJvYcCUYire94rWG6a5k+92jvFVwEo0oAjoVtpzoqP9XJOaCD7CUGVxcwibhmW0tqZNA+UhDcTUS4j4ha3mteRq6LWF9zMYoS40EwTC7nRvr X-Gm-Message-State: AOJu0Yz4Cj/BfTErRvissbZVJOel2k6zRKK9Hh5lr615Fm9atLnoX7hQ RBONjJDfDiwK72q5e6IIoDm78iGTUpF+N29W6EpfIBnxLcgwNzJfGyhdXZkZR6+zI28fu+NT8N7 6XlVYVgod6wPxVwj//7W47iXVTDmC+yY5iGb/ X-Received: by 2002:a05:6122:7ca:b0:4da:aff6:5eee with SMTP id 71dfb90a1353d-4df69399556mr657304e0c.15.1715114333777; Tue, 07 May 2024 13:38:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240426133310.1159976-1-stsp2@yandex.ru> <20240428.171236-tangy.giblet.idle.helpline-y9LqufL7EAAV@cyphar.com> <20240507-verpennen-defekt-b6f2c9a46916@brauner> In-Reply-To: <20240507-verpennen-defekt-b6f2c9a46916@brauner> From: Andy Lutomirski Date: Tue, 7 May 2024 13:38:42 -0700 Message-ID: Subject: Re: [PATCH v5 0/3] implement OA2_CRED_INHERIT flag for openat2() To: Christian Brauner Cc: Aleksa Sarai , Stas Sergeev , "Serge E. Hallyn" , linux-kernel@vger.kernel.org, Stefan Metzmacher , Eric Biederman , Alexander Viro , Andy Lutomirski , Jan Kara , Jeff Layton , Chuck Lever , Alexander Aring , David Laight , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, Paolo Bonzini , =?UTF-8?Q?Christian_G=C3=B6ttsche?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 7, 2024 at 12:42=E2=80=AFAM Christian Brauner wrote: > > > With my kernel hat on, maybe I agree. But with my *user* hat on, I > > think I pretty strongly disagree. Look, idmapis lousy for > > unprivileged use: > > > > $ install -m 0700 -d test_directory > > $ echo 'hi there' >test_directory/file > > $ podman run -it --rm > > --mount=3Dtype=3Dbind,src=3Dtest_directory,dst=3D/tmp,idmap [debian-sli= m] > > $ podman run -it --rm --mount=3Dtype=3Dbind,src=3Dtest_directory,dst=3D/t= mp,idmap [debian-slim] > > as an unprivileged user doesn't use idmapped mounts at all. So I'm not > sure what this is showing. I suppose you're talking about idmaps in > general. Meh, fair enough. But I don't think this would have worked any better with privilege. Can idmaps be programmed by an otherwise unprivileged owner of a userns and a mountns inside? > Many idmappings to one is in principle possible and I've noted that idea > down as a possible extension at > https://github.com/uapi-group/kernel-features quite a while (2 years?) ag= o. > > > I haven't looked at the idmap implementation nearly enough to have any > > opinion as to whether squashing UID is practical or whether there's > > It's doable. The interesting bit to me was that if we want to allow > writes we'd need a way to determine what the uid/gid would be to write > down. Imho, that's not super difficult to solve though. The most obvious > one is that userspace can just determine it when creating the idmapped > mount. Seems reasonable to me. If this is set up by someone unprivileged, it would need to be that uid/gid.