From nobody Sat Aug 03 14:59:15 2024 X-Original-To: freebsd-hackers@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 4Wbm7h4FWHz5SZ2n for ; Sat, 03 Aug 2024 14:59:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbm7h2St1z4Lss for ; Sat, 3 Aug 2024 14:59:28 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ua1-f54.google.com with SMTP id a1e0cc1a2514c-825a23c5e4cso2109755241.3 for ; Sat, 03 Aug 2024 07:59:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722697167; x=1723301967; 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=BlmKVfuM9Bw/Si/uiawLEB/KWNGMW1VtVUQ7d3nILDU=; b=Fb3vpQ2vGhnycdhufq9R8CHI2+6EaIBWNvQGtXBkCUx7zw4iqGAoOOnCWowN6Rjeno SdDvspXPitp8jm3w1iwbHzIdJd198IxnieW0uHUNb9Y/1tS79hFxQbfMJdhss8TNyaEO W71P0kB6w1Z5zfTEpI7xrJtn1z+ovH33tyDHjmnarFtXTYdInG8GsTIZ8H1zKg7tQ0u+ fxjbn0uOCQDRGgmlC4Lqeoyp6g2xBYXm9PvxMbJAt/yxKf13aPaygs4pGu7ev4BAWfI3 ob+VUEgppCDt9c3D5K8kAM0i9MfJZnEtZkNwMELo7sF4kYqW7KR3sMQJW7+7hNor/B0z R7gg== X-Forwarded-Encrypted: i=1; AJvYcCVPsN+wZaK/ZGIpW1QOX0NLnQsEvNRdejMzU+b+XjZLhiJIJU9Qnemt0/Da3FF4kV6FUxzDPlIaFKLAH/eIpMhCqeX3ydltQwamOyE= X-Gm-Message-State: AOJu0Yz5pXEyHSGSutXmcFAUW5nIBPkf4icPkFdAyjJDWKRHmQ51Q+5h 2517Zny/T0niUi7x7QmKXTEaDxVFt1DeqHEuqRcZthXy6paaoDGL/1Ywv7FP5YE+0TQKS0kvw5m 0zgv35mwnFlQS8HhMwl/eV5diZDg= X-Google-Smtp-Source: AGHT+IGIupZ1EuuD7nuSVEsLMch+VcijqcalU5059Oi5WYkzqFpJol9b+nZD2m1w7f7l5pi3M/GhB9Eq1BgsYJZ5LH8= X-Received: by 2002:a05:6102:4408:b0:48f:9324:db08 with SMTP id ada2fe7eead31-4945bde6c6emr7019414137.4.1722697166933; Sat, 03 Aug 2024 07:59:26 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <20240803131134.20f61fe590d1929a1733abc3@dec.sakura.ne.jp> In-Reply-To: <20240803131134.20f61fe590d1929a1733abc3@dec.sakura.ne.jp> From: Alan Somers Date: Sat, 3 Aug 2024 08:59:15 -0600 Message-ID: Subject: Re: RFC: ACLs on fusefs To: Tomoaki AOKI Cc: Ka Ho Ng , FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4Wbm7h2St1z4Lss Storing ACLs in hidden files is beyond the scope of what I had in mind. That would be an entirely new challenge. And it wouldn't be possible to do it correctly, because the file system server is still responsible for the inheritance of default ACLs. For the present, all that I have in mind is file systems that can store ACLs natively. On Fri, Aug 2, 2024 at 10:11=E2=80=AFPM Tomoaki AOKI wrote: > > I'm not understanding the implementation of fusefs, but possible > problem to be considered is the levels of suuports for EAs and ACLs of > each implemented filesystems. > > What I recall is the implementation of EAs on OS/2. > IIRC, HPFS natively supported EAs and WPS/Presentation manager-specific > attributes (like registry on recent Windoze). > To support both on FAT, OS/2 used 2 hidden system files named > EA_DATA.SF and WP_ROOT.SF respectively. > > What's needed to consider would be: > a) Store EAs and ACLs on hidden system files with fixed name > on the root directory of filesystems which don't support > EAs and/or ACLs. > > b) Silently ignore unsupportd attributes/ACLs and store supported > ones only without returning error. > > c) Error out if any of unsupported attributes/ACLs are specified. > > Maybe b) would be fatally problematic, as admins who don't understand / > don't want to learn about implementations in deep would missingly > believe every attribs/ACLs are completely and flawlessly stored even on > filesystems which does not support them. > > a) would be best, if ALL FUSEFS GUYS ON OTHER OS'es agree with the > specific filename and its internals, promissing to implement theirs as > such, too. Unfortunately, maybe not realistic, unless ISO/IEC or POSIX > mandates the support and standardize the name and formats of special > file. > > > On Fri, 2 Aug 2024 22:53:05 -0400 > Ka Ho Ng wrote: > > > Having said that, I am not sure if the FUSE protocol itself is extensib= le > > to accommodate the needs to directly implement the counterparts of our > > existing ACL syscalls. Otherwise XATTR tunneling for both NFSv4 and POS= IX > > 1.e on FUSE might be the only way to go. > > > > May I know if there're any users of the XATTR approach besides the > > e2fsprogs/fuse2fs implementation of the EXT4 filesystem? > > > > Ka Ho > > > > On Fri, Aug 2, 2024, 22:34 Ka Ho Ng wrote: > > > > > I would rather see the support of XATTR and NFSv4 ACL being two ortho= gonal > > > things, just like how it's being worked out on ZFS. > > > > > > On Fri, Aug 2, 2024, 19:58 Alan Somers wrote: > > > > > >> TLDR; > > >> how useful would it be if fusefs(4) could support ACLs? > > >> > > >> The current state of fusefs is that while it has full support for > > >> extended attributes, it lacks any support for ACLs. If a file syste= m > > >> image contains files with ACL entries, the user can look them up wit= h > > >> getextattr, but they'll just look like a binary blob. getfacl won't > > >> work at all. And the file system won't be able to enforce the ACLs > > >> during VOP_ACCESS. > > >> > > >> Fixing this situation for posix.1e ACLs would require three things: > > >> * A good test suite for posix.1e ACLs. pjdfstest has some tests, bu= t > > >> it's incomplete. > > >> * An example file system to use for testing the kernel driver. It > > >> isn't sufficient for the example file system merely to support xattr= s, > > >> because the file system server must also enforce inheritance of > > >> default ACLs. > > >> * The actual kernel support. Enforcing ACLs during VOP_ACCESS must = be > > >> done within the kernel, not the server. The important parts are > > >> already in sub_acl_posix1e.c. The fusefs test suite would need a fe= w > > >> more test cases for VOP_GETACL and VOP_SETACL, but wouldn't need to > > >> test any of the fancy stuff, like inheritance or enforcement during > > >> access. > > >> > > >> Fixing the situation for NFSv4 ACLs would require the above, and als= o > > >> a small extension to the fusefs protocol. > > >> > > >> All of the above might make a good GSoC project. But is it worth ou= r > > >> time? How many real-world users would benefit? Alternatively, doin= g > > >> just the kernel support would be fairly easy. That would be too sma= ll > > >> for GSoC. But we could easily overlook important bugs if we don't d= o > > >> the other steps, too. > > >> > > >> So my question is: is this worthwhile? Does anybody know of a > > >> real-world workload that would benefit? > > >> > > >> > > > -- > Tomoaki AOKI >