Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp248932iol; Thu, 9 Jun 2022 03:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN/5JP3M+RbuTzlakIibv5L83ET4KNW1npWIkJKpJwDZK3tpMfRUL5lMwV8U26kIB7WxAQ X-Received: by 2002:a17:906:6a23:b0:711:ea9b:89ba with SMTP id qw35-20020a1709066a2300b00711ea9b89bamr9552080ejc.740.1654769434406; Thu, 09 Jun 2022 03:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654769434; cv=none; d=google.com; s=arc-20160816; b=HPdVSc6nX92FOEegUi+zfWBRemOCOA9r5MNDjuIw+NdkAHmZmFzuUbadxY7dBHVUNC VqAg/yF3kaKbqG5QtR8/0D8jwy5QbWskHWKQqg/JhWD1Wm9M2nS9qj3OTVheZIrTlXIL BLLrVMgESguO2yj5+YLtCoOLFNV9492pP6WIyW3/hUX7JiYQ77qwIcDy95stafZh0mqY CYrm546u7Gdev7afU4otZR/2vBLsthqW6OltLgb5hs3EVL4yepUTarFwWQ0CRxSg0dU3 6CikDSyPB74niyhPPI2Q+1WdD5hqdFyhaL/BE76Dv6zAF3nmxWGiNQnQGRo8lbNRFIo3 VInw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ON3Pub6AHUCAeH8SyvUYJIu2FNlMbAkSzqXkvKSDFAg=; b=C+WoargrMq0kpO7F8+la4uu5TSUu/uVWBle64I550GNBvbkmekVt+JnHCWjbrpWCOO IZ6McfPbNd7zliHegX0ywmZIjtHziDWBcIeQEY7VeBReDkQMMe6tBD3A9ncUwCBoOQGP 22bqMG/Y5LuS+BidazeMERPWp4+zuIa2BTLNQhqHGsawNMbXmvl1fkAUIUb8HPcH+Fsu ld0Rdol9WHxd/OCseZazhwaPBe7zlN1R1KNtKItViXo3SfwNGbtulvBnU9jrnSL4wN0N 2l8b94/zpdHZUvEjB4jEB24RGantY8DmhinSNB5hw8hNPc+JXYvhHRxiDKh+tDkSJGwm OV/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=GQGMNkYU; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jz23-20020a17090775f700b00708e5cbd894si6187651ejc.431.2022.06.09.03.09.52; Thu, 09 Jun 2022 03:10:34 -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=@googlemail.com header.s=20210112 header.b=GQGMNkYU; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239913AbiFIJPA (ORCPT + 99 others); Thu, 9 Jun 2022 05:15:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230290AbiFIJO6 (ORCPT ); Thu, 9 Jun 2022 05:14:58 -0400 Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60FEE175B9; Thu, 9 Jun 2022 02:14:57 -0700 (PDT) Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-f2e0a41009so30286312fac.6; Thu, 09 Jun 2022 02:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ON3Pub6AHUCAeH8SyvUYJIu2FNlMbAkSzqXkvKSDFAg=; b=GQGMNkYUeeI8CBd4rHlhZMbMb3aFVGJ622JnZaJbfYjMOpW//pg9bwsiKfnK+KtyZC F29KG67ibpRAlUQu9L1mqeQcodqCjp9/KVh9r6Ti7s796zZ3e8qyxKXfqhMSzmJJMghQ 6SZufhAgEm44JFBmc+9PPeey4LVGSlAsGyTfrb9LHB2sf9pEhGdb37aQhPXIzGeajfYN b/wxtKuV3vTHRRv+2ldMn71jxtWrYfKDRN+O5EaMewxuHfIRmvxQofwtB7T57uX2WajW APkEsAfzBlAbvHo2/bB27eDOq3IZxXij2keapnpqY4F7LFS03IwsbLgtOmw2xuMeK3zZ fzWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ON3Pub6AHUCAeH8SyvUYJIu2FNlMbAkSzqXkvKSDFAg=; b=eqACfIByrlPzVoeheDyoiFwiMvmBfdzrH/1SwN1Ls6iTURLonGStk1Qg5C0iX54xji HRrtwR5zWHXRnDxncUMneDdjE6Y+PONkG16a+muu1UwGOOpdoHglMb9LF2kd7zskx0CD yMKsfK4Wq5vmCsq4PIagzBAl3Xmzf/d5utTRnREczF2qCq5f14rlKY+j4UHARPhQJq+V e5hgZi3snTUiRMcnoA9fB2eJnHwWdFBty85XhFA3wpTNc1c8Q6fMgVROv+cQKhN5crCe 2tb/nWRlfSuUIctMaP4+4vzB7WUTuTDSu+nadTDnRXJ26dgkUz+YbT/WwnCDd55NVJN8 ipng== X-Gm-Message-State: AOAM530ccIUCSVjHgAQ722zsfJvKXsLjhAQWjPC45vjWCuOaW/m0Ywef CODQ3/OpivkX8qEr8L+JLAZOaCnwyWw3Zi67j2cSgqSt7JQ= X-Received: by 2002:a05:6870:e40c:b0:f3:2f32:7c3d with SMTP id n12-20020a056870e40c00b000f32f327c3dmr1152770oag.71.1654766096472; Thu, 09 Jun 2022 02:14:56 -0700 (PDT) MIME-Version: 1.0 References: <20220607153139.35588-1-cgzones@googlemail.com> <08A11E25-0208-4B4F-8759-75C1841E7017@dilger.ca> In-Reply-To: From: =?UTF-8?Q?Christian_G=C3=B6ttsche?= Date: Thu, 9 Jun 2022 11:14:45 +0200 Message-ID: Subject: Re: [RFC PATCH] f*xattr: allow O_PATH descriptors To: Amir Goldstein Cc: Andreas Dilger , SElinux list , Miklos Szeredi , Linux API , linux-man , Alexander Viro , linux-fsdevel , linux-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 On Thu, 9 Jun 2022 at 06:36, Amir Goldstein wrote: > > On Wed, Jun 8, 2022 at 9:01 PM Andreas Dilger wrote: > > > > On Jun 7, 2022, at 9:31 AM, Christian G=C3=B6ttsche wrote: > > > > > > From: Miklos Szeredi > > > > > > Support file descriptors obtained via O_PATH for extended attribute > > > operations. > > > > > > Extended attributes are for example used by SELinux for the security > > > context of file objects. To avoid time-of-check-time-of-use issues wh= ile > > > setting those contexts it is advisable to pin the file in question an= d > > > operate on a file descriptor instead of the path name. This can be > > > emulated in userspace via /proc/self/fd/NN [1] but requires a procfs, > > > which might not be mounted e.g. inside of chroots, see[2]. > > > > Will this allow get/set xattrs directly on symlinks? That is one probl= em > > that we have with some of the xattrs that are inherited on symlinks, bu= t > > there is no way to change them. Allowing setxattr directly on a symlin= k > > would be very useful. > > It is possible. > See: https://github.com/libfuse/libfuse/pull/514 > Does it really? (It should not since xtattr(7) mentions some quota related issues.) In my tests setting extended attributes via O_PATH on symlinks fails with ENOTSUP (even as root), except for special ones, like "security.selinux". > That's why Miklos withdrew this patch: > https://lore.kernel.org/linux-fsdevel/CAOssrKeV7g0wPg4ozspG4R7a+5qARqWdG+= GxWtXB-MCfbVM=3D9A@mail.gmail.com/ > > Thanks, > Amir.