Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26978377rwd; Mon, 3 Jul 2023 18:41:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqHf9/nGyZoEiiMiGaoqgjuY0+qbguYKqKj3AmrBgoT9TooEl1qR6izokGoerkJZrRDfHS X-Received: by 2002:a05:6871:89ca:b0:1b0:3f7f:6733 with SMTP id tk10-20020a05687189ca00b001b03f7f6733mr10391404oab.44.1688434879280; Mon, 03 Jul 2023 18:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688434879; cv=none; d=google.com; s=arc-20160816; b=oE9vL+j+/1oDspF8YdXRRclvHioYHoBcqET7xXQbyjbkLGgqjA1qTCRniL1iUxoR6R 4QB5hUKfbnx1atn0DJtlHyuhi1RzyzLa/XGAw3bMvUhkoy3GCeOPoDcWIq9G6PMUcDIY B/zLtLXjbM23ArL0c1lvJBjKYADy5yD8Y6OwheZ++GSptOQmAO/lPMhEk4kju4dHwG9I Hfr2r1WwTlmP70NtaJlTIE9Q1ADgdRVEt6NEl6kkrxWm7EMBl336NihlxYn8FOFiRDXR jvD76q86v4XPNMwxnw5wcVKXEqCfILAn2R1VKZcvDJ+QiwW/fqNa01Ws4cM1NbofkucG e49A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=WXCms+65LqYKrmZBhhf/y9w2Ow+x0tGEGBk7yYwG+Bc=; fh=cInLN82Pj4hl1FmaW52MkVs0JK3Ra1pu/h8506goSk4=; b=GD+ZtpDuJMDKifL5z7XMwvkegpg7UlVtjFTm3fdOIqWVk0TrOcmSUID/Mcu5XPc80D E2hu0n+3SILsYnP6DpukWkJfgiy88/+DCR4BZ/yzL9g6fnlHtv9hqNX1fDnNBK/z85oj isyaOZ5TYr5yMYvp4hPNWRmmiM3xEUwabFgw6LiBcF40iLnD/y9MaZw9DnvsBY370FUF hTW//lvhB+3Bz6jdPHq4xTj5+oPNLmbtJ9Osp+H+eEcpVjfXiIZZigLJPLHGR7+7ojNo Oa23rVP2L67hxoOr+vAf5Ubsw2wIpHfqDQq9uubD1hQ5wWC5kXDCvTP0ci229wqlLKy0 Sbcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BP+vM54A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 34-20020a631662000000b005572b2f6ea2si19199771pgw.272.2023.07.03.18.41.04; Mon, 03 Jul 2023 18:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BP+vM54A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231209AbjGDBJy (ORCPT + 99 others); Mon, 3 Jul 2023 21:09:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230294AbjGDBJs (ORCPT ); Mon, 3 Jul 2023 21:09:48 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2187BE49 for ; Mon, 3 Jul 2023 18:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688432942; 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=WXCms+65LqYKrmZBhhf/y9w2Ow+x0tGEGBk7yYwG+Bc=; b=BP+vM54At6m7wRiZPLnwC0uiL/y65a94Al32Injz7Py6Nskx6l0DAJBljefga3CJh8NoAK KleDb8CGnXnXHf5xkEXfFLyFaq2cDdnYqcWBN0OzunaZLmOjEzoXEeWEpYXOKuNbXTQa39 /C/csR/E1hGxptpbKi9zWLcFp8xRanE= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-alh9DDOFPkmFGaRev2R1IQ-1; Mon, 03 Jul 2023 21:09:01 -0400 X-MC-Unique: alh9DDOFPkmFGaRev2R1IQ-1 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-1b89e3715acso12120935ad.3 for ; Mon, 03 Jul 2023 18:09:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688432940; x=1691024940; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WXCms+65LqYKrmZBhhf/y9w2Ow+x0tGEGBk7yYwG+Bc=; b=ZniizQwNYbA0rNwpM7JrpwCQ3AD4O8sO3+7iJDq6KDAyLHKiOOrnxEYBVWvi+TjeZu pkeC8fdfQvgNvOXKAm4kRbaru4KOHhBoR2aR5ckQ9CwXs87m6h+SMiOxu4yJ6b8LMAxV J46cO6V5uoEJEFk5RP1X75NNz+k2KzEryBrQatgN8cHLDa8puzUcmxiP8dPVIUDcBeKA chaprd+tsGoAlYKTiKal3aBDqXopQuTv69mE0l+KObALj5DTSVGlQHW5ke3eOSY/YB3q sttUj0KVfV6wOElIpxtL+4HaTF/B6KPfYnXcZ3ENwTa3wJSRoNQN5ruZT32XhCV2ND3o vLTg== X-Gm-Message-State: ABy/qLY4NWRZqlellCdo76GHuxORUABzlNLlZyS3JPD1GyGaPvsY5rfa sZ47MamSasGA84C5p65RX3h9q38TnO+HEah7yWFo/wdc/EAl7RQ1GYobj4KD8aHjAiiq1aRFfhe 0WurEhTGaKWUvSaQ+2lZtD8UBZmO1lwcVJ9Z71Q== X-Received: by 2002:a17:902:ab81:b0:1b8:21f:bcc2 with SMTP id f1-20020a170902ab8100b001b8021fbcc2mr8285845plr.34.1688432940154; Mon, 03 Jul 2023 18:09:00 -0700 (PDT) X-Received: by 2002:a17:902:ab81:b0:1b8:21f:bcc2 with SMTP id f1-20020a170902ab8100b001b8021fbcc2mr8285835plr.34.1688432939786; Mon, 03 Jul 2023 18:08:59 -0700 (PDT) Received: from [10.72.12.93] ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id w1-20020a170902d70100b001b523714ed5sm15873685ply.252.2023.07.03.18.08.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Jul 2023 18:08:59 -0700 (PDT) Message-ID: <0a42c5d0-0479-e60e-ac84-be3b915c62d9@redhat.com> Date: Tue, 4 Jul 2023 09:08:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Xiubo Li Subject: Re: [PATCH v5 00/14] ceph: support idmapped mounts To: Aleksandr Mikhalitsyn Cc: Gregory Farnum , Christian Brauner , stgraber@ubuntu.com, linux-fsdevel@vger.kernel.org, Ilya Dryomov , Jeff Layton , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230608154256.562906-1-aleksandr.mikhalitsyn@canonical.com> <20230609-alufolie-gezaubert-f18ef17cda12@brauner> <977d8133-a55f-0667-dc12-aa6fd7d8c3e4@redhat.com> <626175e2-ee91-0f1a-9e5d-e506aea366fa@redhat.com> <64241ff0-9af3-6817-478f-c24a0b9de9b3@redhat.com> <4c4f73d8-8238-6ab8-ae50-d83c1441ac05@redhat.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry, not sure, why my last reply wasn't sent out. Do it again. On 6/26/23 19:23, Aleksandr Mikhalitsyn wrote: > On Mon, Jun 26, 2023 at 4:12 AM Xiubo Li wrote: >> On 6/24/23 15:11, Aleksandr Mikhalitsyn wrote: >>> On Sat, Jun 24, 2023 at 3:37 AM Xiubo Li wrote: >>>> [...] >>>> >>>> > > > >>>> > > > I thought about this too and came to the same conclusion, that >>>> UID/GID >>>> > > > based >>>> > > > restriction can be applied dynamically, so detecting it on mount-time >>>> > > > helps not so much. >>>> > > > >>>> > > For this you please raise one PR to ceph first to support this, and in >>>> > > the PR we can discuss more for the MDS auth caps. And after the PR >>>> > > getting merged then in this patch series you need to check the >>>> > > corresponding option or flag to determine whether could the idmap >>>> > > mounting succeed. >>>> > >>>> > I'm sorry but I don't understand what we want to support here. Do we >>>> want to >>>> > add some new ceph request that allows to check if UID/GID-based >>>> > permissions are applied for >>>> > a particular ceph client user? >>>> >>>> IMO we should prevent user to set UID/GID-based permisions caps from >>>> ceph side. >>>> >>>> As I know currently there is no way to prevent users to set MDS auth >>>> caps, IMO in ceph side at least we need one flag or option to disable >>>> this once users want this fs cluster sever for idmap mounts use case. >>> How this should be visible from the user side? We introducing a new >>> kernel client mount option, >>> like "nomdscaps", then pass flag to the MDS and MDS should check that >>> MDS auth permissions >>> are not applied (on the mount time) and prevent them from being >>> applied later while session is active. Like that? >>> >>> At the same time I'm thinking about protocol extension that adds 2 >>> additional fields for UID/GID. This will allow to correctly >>> handle everything. I wanted to avoid any changes to the protocol or >>> server-side things. But if we want to change MDS side, >>> maybe it's better then to go this way? > Hi Xiubo, > >> There is another way: >> >> For each client it will have a dedicated client auth caps, something like: >> >> client.foo >> key: *key* >> caps: [mds] allow r, allow rw path=/bar >> caps: [mon] allow r >> caps: [osd] allow rw tag cephfs data=cephfs_a > Do we have any infrastructure to get this caps list on the client side > right now? > (I've taken a quick look through the code and can't find anything > related to this.) I am afraid there is no. But just after the following ceph PR gets merged it will be easy to do this: https://github.com/ceph/ceph/pull/48027 This is still under testing. >> When mounting this client with idmap enabled, then we can just check the >> above [mds] caps, if there has any UID/GID based permissions set, then >> fail the mounting. > understood > >> That means this kind client couldn't be mounted with idmap enabled. >> >> Also we need to make sure that once there is a mount with idmap enabled, >> the corresponding client caps couldn't be append the UID/GID based >> permissions. This need a patch in ceph anyway IMO. > So, yeah we will need to effectively block cephx permission changes if > there is a client mounted with > an active idmapped mount. Sounds as something that require massive > changes on the server side. Maybe no need much, it should be simple IMO. But I am not 100% sure. > At the same time this will just block users from using idmapped mounts > along with UID/GID restrictions. > > If you want me to change server-side anyways, isn't it better just to > extend cephfs protocol to properly > handle UID/GIDs with idmapped mounts? (It was originally proposed by Christian.) > What we need to do here is to add a separate UID/GID fields for ceph > requests those are creating a new inodes > (like mknod, symlink, etc). BTW, could you explain it more ? How could this resolve the issue we are discussing here ? Thanks - Xiubo > > Kind regards, > Alex > >> Thanks >> >> - Xiubo >> >> >> >> >> >>> Thanks, >>> Alex >>> >>>> Thanks >>>> >>>> - Xiubo >>>>