From nobody Tue Apr 01 23:08:46 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 4ZS3bK2Q82z5sFtM for ; Tue, 01 Apr 2025 23:09:01 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 4ZS3bJ1v8Tz3gJb for ; Tue, 01 Apr 2025 23:09:00 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=GZWPkyrI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::532 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5e535e6739bso9927577a12.1 for ; Tue, 01 Apr 2025 16:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743548939; x=1744153739; 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=ehcAXHJ+06dMlp9tyzgEJOft2+b8hXqwmZcWC+Q6vaM=; b=GZWPkyrIAN4lZ+9ABV+aKNeTTSHzkYIygEFp+mYd4RWLUOwpXnqdGDxmVSzBCybObw eJ+kNhstGDNzWcMx1+ceMSqwBel8ujVuM/fxHufXbaGbhDuilE1pPp3jJYB25+REA/3h 2xHrMFJGwEbAdXrfC86iKUb53aQ04hvT5dLyOQezH+siyBS3E/3hpK6ifmtM8hCgvlIp Vu+1Wt/lyJv8jERJwCKDQvnOJwwE6Px9R+nvW2XHMLfZ4FoYWEGf1LSFHg+qIo/HzPqw EycplmA/zATbCP9dk3KtkcjDPeBtILwuKJhtb+mbHj0MYe9HFp44W9y+DkJowdt6rV8a cs2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743548939; x=1744153739; 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=ehcAXHJ+06dMlp9tyzgEJOft2+b8hXqwmZcWC+Q6vaM=; b=tY/34DShnH4aghfd6F4u/pO0turCgFJdwOF2UUnqw8JXRNq/NGE6sRLf9MTVLqBO/H KnkfOvf0v8hikxVUFiVs/Gcl001oeyqO5EV+kCTh4wh4K8D6c8X6UNRI9NBvUtMcAFAX li0UHc/knHrAwgEyn/B+NSzWIzty+H/Fdz4NZLGc5omIrdmiN/IdqmsK6up7CJ/dqaFc 7upLxKx3Z7kOT5cnhdTT1avEIdaqOlFT07kHOyXdN/Fuc/mt1HM+DuKBaErmU4JZjL3A 3drJKD36ETTGyk2W1wTjt0uK0fTD1NVb/5RxGJ3whs0RdM/VzrofQ5VNwk7FxT49VfLB JlQA== X-Forwarded-Encrypted: i=1; AJvYcCViwSQdOSjhBJpM2jV8S/wTAnxpOPHK6o0SlzKq48KR5YX107+igp17hB3KCtUJbMHItCa3ATCdTBibEjBvi+w=@freebsd.org X-Gm-Message-State: AOJu0Yzieth8tSk3IWkNrP4kOvyb+C1urWj1Cb2bsP5PloEOWpwmt/rw OoLvPcQJO5H/NUt2synGfSXCVikpRDalEgCbu7RnY89PNK3dkcHWXYdDwSFvELLiaGQXJ9DBdWr 4sgW3NlZfhzonyXA9YENORtKWFan234g= X-Gm-Gg: ASbGncsY5Ml2s5rRo6aZgg7bgUi/FjHKNVD+oz2tZ/sx1ZTEHXWgXsH7JijaHBHVZ2p 3W5TAwZASdyfbUSF2gcIA7soEHSJ/dF4UFSWmA+XTPVXAD7paS8qLUvqyfnXiqlvvPGHYhDr385 LkA1/TVEpLeNqFUiOvOXwZ0UGsXK1kUwceHvVkfUAuGkzWHs9V4DO/P6VGoA== X-Google-Smtp-Source: AGHT+IEj629qnRUwKFbxgaTYP2Eci6lwDeul0tLSuI8s4/HwuoWss0Tg8JRHzUQBplgSJhnD6q93KqnB9F0NQyHTS2M= X-Received: by 2002:a05:6402:c4a:b0:5e4:d2c9:455c with SMTP id 4fb4d7f45d1cf-5edfceaa4c0mr14141885a12.10.1743548938217; Tue, 01 Apr 2025 16:08:58 -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: <410014e4-75a6-4923-8f84-3935cab41c31@blastwave.org> <3dso3cojzxnylcfmpmgwzizp4omzpmnbfgz3zt5pvgeur4wss6@kblfkmtssebw> In-Reply-To: From: Rick Macklem Date: Tue, 1 Apr 2025 16:08:46 -0700 X-Gm-Features: AQ5f1JrJ2Jr2KJPwhjYh-_PbLFXzry7LodvuH4li2E-J9ok_2tmgylEe7OZhyLU Message-ID: Subject: Re: RFC: Solaris style extended attributes for FreeBSD To: Shawn Webb Cc: Dennis Clarke , freebsd-current@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [1.13 / 15.00]; NEURAL_SPAM_MEDIUM(0.90)[0.899]; NEURAL_SPAM_LONG(0.72)[0.719]; NEURAL_SPAM_SHORT(0.51)[0.510]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TAGGED_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::532:from]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4ZS3bJ1v8Tz3gJb X-Spamd-Bar: + On Sat, Mar 29, 2025 at 1:22=E2=80=AFPM Rick Macklem wrote: > > On Sat, Mar 29, 2025 at 1:09=E2=80=AFPM Shawn Webb wrote: > > > > On Sat, Mar 29, 2025 at 01:04:08PM -0700, Rick Macklem wrote: > > > On Sat, Mar 29, 2025 at 12:50=E2=80=AFPM Shawn Webb wrote: > > > > > > > > On Sat, Mar 29, 2025 at 12:39:02PM -0700, Rick Macklem wrote: > > > > > > I had added filesystem extended attribute support to libarchive= , which > > > > > > is what FreeBSD's tar(1) is based off of. I upstreamed that, so= that's > > > > > > taken care of. FreeBSD's tar(1) has supported extended attribut= es > > > > > > since 2020 (see libarchive PR 1409: > > > > > > https://github.com/libarchive/libarchive/pull/1409) > > > > > Ok, thanks for the info. If this stuff goes into FreeBSD, it prob= ably needs > > > > > to be tweaked to use the different syscall API so that it can han= dle large > > > > > attributes and maybe the attribute's mode. (someday, maybe?) > > > > > > > > I believe libarchive has been updated in FreeBSD since October 2020= , > > > > so the vendored libarchive in FreeBSD should already support it. Bu= t, > > > > yeah, if FreeBSD makes changes to how extended attributes work, I o= r > > > > someone else would need to update libarchive to account for that. > > > > > > > > Since HardenedBSD follows FreeBSD closely (we sync every six hours)= , I > > > > would probably volunteer to update the libarchive code. > > > > > > > > > > Just one data point here: HardenedBSD uses filesystem extended > > > > > > attributes to toggle certain exploit mitigations on a per-appli= cation > > > > > > basis. That's why we added support to libarchive: so we can shi= p > > > > > > certain packages with exploit mitigations pre-toggled. > > > > > Just curious. Does it use "system" or "user" attribute space? > > > > > > > > We use the system namespace, though the userland tool (hbsdcontrol) > > > > was recently taught about the user namespace. The kernel side only > > > > supports system namespace. So the user namespace support in > > > > hbsdcontrol is somewhat meaningless. I do plan to eventually get to > > > > the kernel side, but my TODO list continues growing. :-) > > > Ok, this wouldn't be affected by the patches I've been doing, since t= hey > > > handle user space only. (system space will still work, but only via t= he > > > extattr_XXX() APIs. > > > > Cool. I have another project that uses user namespaces: > > https://git.hardenedbsd.org/shawn.webb/altfs > > > > AltFS is a fusefs driver that stores file payload in filesystem > > extended attributes, using the user namespace. It only partially works > > and again is bitten by more important items on my TODO list. It mainly > > serves as a proof-of-concept for a weird data exfiltration technique. > > Not at all meant for actual production use. > > > > Do you already have a patch for review in Phabric? I might want to add > > myself to it so I can more easily keep informed. > Not yet. I am still cleaning things up and testing. I have put the VFS/syscall changes up in phabricator under D49583. I listed a few reviewers, but anyone is welcome to review/comment on it. rick > Also, there ahs not been much response related to the question "should th= is > go in FreeBSD?". Dennis doesn't sounds like a "no" and the two posters on > freebsd-hackers@ I assume are a"yes", but I haven't heard from anyone els= e. > (Good technical comments, but not related to "should it be in FreeBSD?".) > > rick > > > > > Thanks, > > > > -- > > Shawn Webb > > Cofounder / Security Engineer > > HardenedBSD > > > > Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 > > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb= /03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc