From nobody Sat Jan 31 21:59:56 2026 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 4f3Rd01lVSz6QY71 for ; Sat, 31 Jan 2026 22:00:04 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) (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 4f3Rcz154Fz3VV5 for ; Sat, 31 Jan 2026 22:00:03 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=asViZZma; dmarc=pass (policy=none) header.from=hardenedbsd.org; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::331 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-7cfd95f77a3so2168634a34.0 for ; Sat, 31 Jan 2026 14:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1769896797; x=1770501597; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wj++72UXF3x7Jn4pErwq17znbe9tdX1Wwx6WA8bIr4U=; b=asViZZma2ouj4oJ4Oi18VHfymGnFpUH7Q09kO5wj9pXKxKzBN3ioi+qc3P814bsiZE GExU6ZFv95y/EU7qJNj0KaesetnJzQrPLs95HnNjcb06qmDCrWfPv6JoLhffxQmKo03z 4omBqglqGrQd6nvY5JjkiDOdBiaBkCB1Ssd4SFwDZirAX8vfOB3So5a5jsDev+3buydS PjDvPi65cVD2GiKGEW8NJGBTooc5UfcITL5FPwXPq35mO7ECKsYZXHQQvrZ6+6FV5gcn SrOdQqnFYCmq9WXwgLuAzgusmggXuw5ZgJhCK1lNTgQQZ8VzFr2wQ5yBvR3lu0YE8vtK 9ITA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769896797; x=1770501597; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wj++72UXF3x7Jn4pErwq17znbe9tdX1Wwx6WA8bIr4U=; b=cGkll1xZhoTy16k1+Tns+FLy5Mw5oGryUGVzMqohpi/k/Z0vhYAcC13rcIluOz9qTN 3aOinU5HmwVcy7LkMXUCqpSXNnHYzwEoICFgq7D8M6g2pzMG3PnLdKQaAIZRwKJytym+ qmMRScq4CSLfcbLhtd7kEs270o42UCNNUxPp0MmwFJYhdYU5gUa6CRLhZOo5fLilMYHJ Q54YUdza6VKnp+hQ+fhHl2cNQD0+8Fammiyue+ZUTOjWduPbtBa8j6d2wSFHgjUZnZBM 6wXPP3Mi0Ul4Kt2lj724GfzLxGXhFtZNmrJEObzh6WT5GS+1+x4MUEumAimC59ZOR0kI /AnA== X-Forwarded-Encrypted: i=1; AJvYcCWRacQ9CLCdnWykMUAdOg+yGJJN0SfWKmXUUQ7CeANYPQhCKw/YBpZ/A74fPK8cwVNhqdMWpDL/0vpqyaiaktQ=@freebsd.org X-Gm-Message-State: AOJu0YyTyteanjo/arr2jsTvqJE/W8TJXjPKDv7KLD2o1oLtajxC+Y7A JkvuVDfKgKxbGAQZ6IH04A4fAt7r3es6OuYxxpROWf647oOC+WObf4ldDqMYsBLeOgc9AMOv1Tm 44TxkyBE= X-Gm-Gg: AZuq6aJC64hXwAYxu3r0ggEbG0MnM1YDip5OjjMs6GZDHFU1niMi450TQtcCav8jNGb j6BreDBIBS99M42p9NxXhrw2LpGlBpzoOiSZVGD+J6wtBww1bpnIrMVQR7cNYglfqLwnnhPkW0/ cRf5aD+0vQDdCVak+sDznS+Q+UDtjXQ9oE7ztXcZLatl3jrGlPorYatEgEwFZ2Vislie7mP8Acz cYYDX89kWsCfV+/xqOS3cOPvL7BTWspestyGZA4Da2MY0W89Y1WWot+Un7fzcNDFosb6tZHzini 79G9H77lCIIQWWiFls1uA2hDseXXtjuLjvZCngmhAliC7DJ0WhjaTRJogyg4KyNqbElS4wBAWAE +dk4T32JcQKGhTsPnGqC/6knggl5pXCmuQmESfdbWkj5g9ijbVTMANwyP4vTUTSQj5Dob X-Received: by 2002:a05:6830:63ca:b0:7d1:8e24:724d with SMTP id 46e09a7af769-7d1a53d3833mr4723430a34.38.1769896797185; Sat, 31 Jan 2026 13:59:57 -0800 (PST) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d18c7ffcbcsm7852773a34.24.2026.01.31.13.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Jan 2026 13:59:56 -0800 (PST) Date: Sat, 31 Jan 2026 21:59:56 +0000 From: Shawn Webb To: Rick Macklem Cc: Lionel Cons , Freebsd hackers list Subject: Re: FreeBSD runat(1) option to open a symlink named attr dir? Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-STABLE-HBSD FreeBSD 15.0-STABLE-HBSD HARDENEDBSD amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: 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 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="j5eax6pn4cti4bpt" Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [-4.59 / 15.00]; SIGNED_PGP(-2.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.989]; DMARC_POLICY_ALLOW(-0.50)[hardenedbsd.org,none]; MID_RHS_NOT_FQDN(0.50)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCPT_COUNT_THREE(0.00)[3]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TAGGED_RCPT(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::331:from] X-Rspamd-Queue-Id: 4f3Rcz154Fz3VV5 X-Spamd-Bar: ---- --j5eax6pn4cti4bpt Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: FreeBSD runat(1) option to open a symlink named attr dir? MIME-Version: 1.0 On Sat, Jan 31, 2026 at 01:37:02PM -0800, Rick Macklem wrote: > On Sat, Jan 31, 2026 at 1:23=E2=80=AFPM Rick Macklem wrote: > > > > On Fri, Jan 30, 2026 at 11:17=E2=80=AFAM Lionel Cons wrote: > > > > > > Can we please get a runat(1) option to open the named attr dir of a s= ymlink? > > > > > > For example add an option -S (and -- end of argument handling) to open > > > the base file,dir,symlink with open(argv[1], > > > O_RDONLY|O_NOFOLLOW|O_PATH)) > > The patch that does this can be found at https://reviews.freebsd.org/D5= 5023 > The current patch causes runat(1) to fail when "-S" is specified and the = file > is not a symbolic link. >=20 > A reviewer asked "Why not just let it process the non-symbolic link?". >=20 > What do others think..should it fail for "-S" if the file is not a symbol= ic > link or should it function anyway (possibly with a warning)? There isn't really a point to this (my) email other than to share some anecdotal data points. =46rom a cursory glance, it looks like there's two ways of approaching symlinks: 1. Default to nofollow. This is the default behavior of zsh's built-in ls. One must pass in the -H flag to follow. 2. Default to follow. This is the default behavior of FreeBSD's /bin/ls (as of this writing, of course). =46rom a security perspective, I prefer t4o default to nofollow. But I can see how that could be confusing to folks. So while I have no strong opinion here, I do slightly lean towards the nofollow side. I relatively recently rewrote the tool HardenedBSD uses to toggle exploit mitigations (hbsdcontrol(8)). hbsdcontrol uses filesystem extended attributes to store its toggle data. It defaults to erroring out if a user passed a symlink rather than the actual executable. We decided to follow zsh's ls flag of -H. Thanks, --=20 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/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --j5eax6pn4cti4bpt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAml+e1MACgkQ/y5nonf4 4frlVA//aypbhG2S/IrlFxRJYbU7u+Y8LMXqo3mhcQg5aonTpeA4xlJrqsahX5Ep XVjPQ0/RTDaCrFWWIGP+8ProXvaLM+VvRIGEWUARHxewdMHJtxJB2mC17/1TO11i dXXt6RIipc4eu/OsULPyCUyK7Izw/GpIrJZSdhVraBKq0M0ObdMGkXFyv+QbA4H8 ik75135M1zcRDb9h0dJ1/fRlwfPa8F9pWxWvdp9VP8LbMbi6Y04KcWWQsemNDlgK AqBb6Ntg7ShNiRDsvYVFysMfJ3U5Od9eaZ4DpwWN/RivgJgvkdE35/0A1wXqtLgN RYpCNI2OY6tDB/m0I9hiPSvxuY/oQNFX56EHoUIemGJ2MZTf5U2FLd/tJLWNho1W XSyPhWCVE0Ik0zv+RQSsiR9GGBv7GmDboTOgKFROT+v6WMoEl4e7jmQ7eBINb+O7 FL4F5kOabFvSU5BwwIlwpLB7O1Uw2XBVV0ZIEXUnXNDZ1ZB9sFPuvAVT7gmMBUJM rFTE0oeD+dt+snghrqs6r2EFAxcbqdDjRj9iy/rNC1NULVJGaZMY5hFlzrpaiz61 dK8Ry/t/axtlPbehZFqAsOvnQzbYKOV0xe47Cm2FbC8UFoHhxAIZg+Fu2Yt3M01v 7bquawqrFOPz+UwJGNPGLGkdiXjUcJ8ZF2NAWw33pcglzqINbaY= =wdT9 -----END PGP SIGNATURE----- --j5eax6pn4cti4bpt--