From nobody Sat Apr 5 02:44:13 2025 X-Original-To: freebsd-current@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 4ZV0DV3zwfz5sqlP for ; Sat, 05 Apr 2025 02:44:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 4ZV0DV25gFz3DBV for ; Sat, 05 Apr 2025 02:44:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5e60cfef9cfso4215671a12.2 for ; Fri, 04 Apr 2025 19:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743821065; x=1744425865; darn=freebsd.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=TLeEKkH/MltK8rE0bQ0M+wqvA+9g7PFHAqxJCu4dgjQ=; b=bGbJNTE0bjKtFHvgAQIz1hY6pfZH1fiwXsuyhKBKzBgyFxhUO/H8/cgVCn1lvxfMRM DSBqKR4Zzmr5v0Vlq8x0ZaNjdqWgx5kQwibDRNPWD89Stv2pqtbqwJqb2HasiFkQhSXR ZHa+tiJm0LR7g6vVP/FCFVSxhNjlnXIeIHoTOIJ/GuSwumWxZAo2KQE3rteDoI2RR4DO 4yNOenq3RYWSaEi8eCvODnW61G2WgtNZXQd8fmidyNm72jaze1QQyqLkDqil39BqElrA x/7uHbLRo7NSGLk3urrYFN5khkHpquu1LpmbaMK5qSlzQG81nYkXJHuXOcjaHKMMEv/7 rolw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743821065; x=1744425865; 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=TLeEKkH/MltK8rE0bQ0M+wqvA+9g7PFHAqxJCu4dgjQ=; b=JsIkWqGXzcnG1t2ki8gt86o+CShVGnOaBRftrrhHRXL7DeMQ74xgVPQC7ZsOjkPNoP JQtkZGoCRs2jqJRaS4fRq5NYSNbrTQhLQz7MLkvwktFXBqoYihUAuu5/hQVko6RLrK9c 21YovJf7qq7QR1UmO9caxP2Svw/dy4Ri2NTyAq0f9s6+8pdtqsdFU5toJ0AKU7MWacls /cwOEMAjfGtffXqLOKkKu99QeQtwPEzonwZ6nR64EuKaLy+oYZilbmKSfkUgJIbVbco4 ppmZtbKuBwQRlVECgDzbKspFA924DIfpKzUZpSvwUivTb58saTMq6iE9XHcN/FXiVt3U 95mQ== X-Gm-Message-State: AOJu0YwbjqkQ/IZWN6PaAzhgtUkvbM6S+Wu/BarjkBZvQFqn3os4EigF FuTXtq+Xcc25NgtQRv63W8/+FaQmaYKPh3e+Oh/WnibTyvejTobCqg1Foq+0U29rn4taRgubXQm RR5C2yGOuGG+g1Ty4fSuLTCxiKw== X-Gm-Gg: ASbGncuqSbWgMsPsr/w93lxXuO9tPqFRsyC65ivmItM5J6ZBsatPXqENCTddnJ+tdyM fT7e71NXUKFx9cCrKfIzHyDxLmdtF5wiMtUpU/tpivOYX6fbn8Vc7/Saf3JoGsle74a4TC8peW5 OH4fvxcu7CtsL0e3oM42qkNwnSyjKx31r+E4mUy41rfDJFwNZ3VXhvueqzSw== X-Google-Smtp-Source: AGHT+IH0i8IlZQmXuiip9YcgeglZaZ8DPzetK6WbUpLruioX6ITJ6PGRR54B9e7DT8c8p5xyzwBCr7a6iwozYEU4+pA= X-Received: by 2002:a05:6402:430e:b0:5ed:61c8:adcf with SMTP id 4fb4d7f45d1cf-5f0db81a6b2mr954440a12.15.1743821064439; Fri, 04 Apr 2025 19:44:24 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <2rq3bpvhclcipvgg3mo4gml7ysuzbvt6rfnzkprceumzeaeh4b@casrpprm6mgt> In-Reply-To: From: Rick Macklem Date: Fri, 4 Apr 2025 19:44:13 -0700 X-Gm-Features: ATxdqUH1geFc0yWgdIxsVz4ghsGzcb27vtW-b__yzi6j9bJCX5qJp1WzvHK0Gyg Message-ID: Subject: Re: Heads Up: commit 2ec2ba7e232d just hit main To: Shawn Webb Cc: FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4ZV0DV25gFz3DBV X-Spamd-Bar: ---- On Fri, Apr 4, 2025 at 6:36=E2=80=AFPM Shawn Webb wrote: > > On Sat, Apr 05, 2025 at 01:27:17AM +0000, Shawn Webb wrote: > > On Sat, Apr 05, 2025 at 01:04:25AM +0000, Shawn Webb wrote: > > > On Fri, Apr 04, 2025 at 05:40:21PM -0700, Rick Macklem wrote: > > > > On Fri, Apr 4, 2025 at 10:50=E2=80=AFAM Shawn Webb wrote: > > > > > > > > > > On Thu, Apr 03, 2025 at 06:12:59PM -0700, Rick Macklem wrote: > > > > > > On Thu, Apr 3, 2025 at 4:52=E2=80=AFPM Shawn Webb wrote: > > > > > > > > > > > > > > On Wed, Apr 02, 2025 at 01:51:26PM -0700, Rick Macklem wrote: > > > > > > > > The commit 2ec2ba7e232d just hit main. I do not think it w= ill > > > > > > > > cause problems, but it is fairly large. > > > > > > > > > > > > > > > > Man page updates will be done as separate commits. > > > > > > > > > > > > > > > > Hopefully this will not cause grief, rick > > > > > > > > > > > > > > Hey Rick, > > > > > > > > > > > > > > The patch review test plan mentions a patch to ZFS itself to = support > > > > > > > named attributes. Is that patch available somewhere? > > > > > > The ZFS patch is currently in phabricator as D49654. > > > > > > Feel free to review it. > > > > > > > > > > > > It can also be found at: > > > > > > https://people.freebsd.org/~rmacklem/zfs-xattr.patch > > > > > > (this is a smaller diff which can be applied to an up-to-date m= ain src > > > > > > tree easily) > > > > > > > > > > Hey Rick, > > > > > > > > > > I applied that zfs patch, but trying pathconf(2) on a file on a Z= FS > > > > > dataset with xattr=3Don (which seems to be the default) returns 0= . Am I > > > > > doing something wrong? > > > > > > > > > > =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D > > > > > hbsd-current-01[shawn]:/home/shawn/tmp $ ./xattrtest xattrtest > > > > > xattrtest: Named attributes not enabled: No error: 0 > > > > > hbsd-current-01[shawn]:/home/shawn/tmp (1) $ zfs list /usr/home/s= hawn > > > > > NAME USED AVAIL REFER MOUNTPOINT > > > > > rpool/usr/home 10.4G 71.4G 9.85G /usr/home > > > > > hbsd-current-01[shawn]:/home/shawn/tmp $ zfs get xattr rpool/usr/= home > > > > > NAME PROPERTY VALUE SOURCE > > > > > rpool/usr/home xattr on default > > > > > =3D=3D=3D=3D END LOG =3D=3D=3D=3D > > > > > > > > > > That xattrtest application is yours from: > > > > > https://people.freebsd.org/~rmacklem/xattrtest.c > > > > No idea. It works for me. You used up-to-date kernel sources? > > > > (Check that VIRF_NAMEDATTR is defined in sys/sys/vnode.h.) > > > > Oh, and one more thing to check. zfs_xattr_compat needs to be non-z= ero. > > > > (It's found in sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_= os.c. > > > > It's initialized to 1 and I don't see anything that sets it to 0?) > > > > > > It is indeed set to 1. > > > > > > > > > > > The only thing I can think if is, if you changed xattr to on, you n= eed to > > > > reboot (or at least remount) to get it to take effect. > > > > (Maybe try setting it to "dir" and then reboot/remount. Maybe there= is > > > > a difference between "on" and "dir"?) > > > > > > Yeah, tried rebooting and still no go. Note that xattr defaults to > > > "on" in FreeBSD by default. My src tree is synced up to FreeBSD commi= t > > > 7e70d94acd68b3ac6b45f49d4ab7a0f7867c3ea7. I brought in the ZFS patch > > > you linked to. > > > > > > > > > > > Or, did you build zfs.ko some other way than as part of a kernel bu= ild? > > > > (It needs the patched .h files in the kernel sources, not something= in > > > > /usr/include/sys > > > > that has not yet been updated.) > > > > All the ZFS changes are #ifdef'd, since OpenZFS requires the source= s > > > > build for older kernels. (Basically #ifdef'd on that VIRF_NAMEDATTR= mentioned > > > > above.) > > > > > > Perhaps I need to do a clean build. I'll try that and report back. > > > > > > > > > > > It does remind me that I need to try a build of zfs.ko by doing a "= make" in > > > > the module directory. > > > > > > > > You can try the attached trivial patch and see if it spits out "pat= hconf ret=3D1" > > > > on the console. > > > > > > I'll try that after a clean rebuild of the kernel. > > > > Clean rebuild didn't resolve it. However, I made some progress. > > > > I created a dataset specifically for this since I can't really unmount > > my /usr/home dataset, so my example down below is a bit different than > > the previous example I gave. > > > > The xattr property is set to "on" for the dataset. However, it's not > > mounted with the xattr property. In order to get it to work, I had to > > run the following commands: > > > > =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D > > $ sudo zfs umount rpool/scratch/xattr > > $ sudo mount -t zfs -o xattr rpool/scratch/xattr /scratch/xattr > > $ zfs get xattr rpool/scratch/xattr > > NAME PROPERTY VALUE SOURCE > > rpool/scratch/xattr xattr on local > > $ mount | grep xattr > > rpool/scratch/xattr on /scratch/xattr (zfs, local, noatime, nfsv4acls, = named attributes) > > $ mount | grep named > > rpool/scratch/xattr on /scratch/xattr (zfs, local, noatime, nfsv4acls, = named attributes) > > =3D=3D=3D=3D END LOG =3D=3D=3D=3D > > > > So it looks like FreeBSD does not honor the xattr zfs property, > > otherwise you would see a whole bunch of datasets mounted with the > > "named attributes" flag in that last `mount | grep` command. > > Here's a little test program I whipped up to copy a shared object into > an extended attribute, then fdlopen the attribute: > https://git.hardenedbsd.org/shawn.webb/random-code/-/commit/32544bcccd29b= 43c2fd70a33e0c685cebb0fdbdf > > It's an ugly PoC, but it works. :-) I wouldn't call it ugly. It looks fine to me. On the other hand, the test programs I use (I have a bunch of them now) are definitely ugly.;-) Thanks for trying this, rick > > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > Signal Username: shawn_webb.74 > Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/0= 3A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc