From nobody Sat Aug 22 10:49:22 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 4hRv7X0KBpz6pgTK for ; Sat, 22 Aug 2026 10:49:28 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-yx1-xb132.google.com (mail-yx1-xb132.google.com [IPv6:2607:f8b0:4864:20::b132]) (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 4hRv7W4x4Wz3R20 for ; Sat, 22 Aug 2026 10:49:27 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yx1-xb132.google.com with SMTP id 956f58d0204a3-66c83e34212so2421410d50.0 for ; Sat, 22 Aug 2026 03:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1787395765; cv=none; d=google.com; s=arc-20260327; b=Jqngldb2pfseEOXXY9UoDqS+kh024UTAvKxAlRPOjAzHwlK4rj/xPVTwW1s25ZR+qp RpxapPlnr6QOssKcS+CqPLf2JRpajtr8o9EPe/PxMpYCG/V2AM5zr1Y2rAsP51Yc7E0H +O0bHjfjrsXeLuA0eI9DqglwxH/4Eu7FA0B3tutauVG1esEAtqefN5IqpIPX6oDEuga8 SznWVSIvtxneqp5Q/vnaNQxr4nTPgCdyT4ZTeGSTLpqvasMXZpJgjNlxxhv/7I6BJ3N/ PEosYO+03aUghmtSLsU/4vU6uv15mqDQHzZRIjYI59RI2QwXpHrNMHoPrj3ZwZ/W8vnW 2eAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:dkim-signature; bh=MPu6t82O9zpTQtTgfwVkvRH/eXKJ8n1ZSUqCHJDW1Eg=; fh=3WmvmSHoeQhvaIFxiL2MA3gW1Op0znqsxg9F9Jif1bM=; b=T6iJbO7ybDcnVXURlYGyaTzRPJtvakiwln+frlI91AmoB23dbOC+ariXrZ3tHvxO+M 6rhssoDZ7QxsrqIytH//Cl2kvPi3Zoe1oZqdXGFMZv0mK9lKmDtwlI8nARB4+/dx3Ar9 wpxR2TaiC8BYPI/oHYrAtCddmS/YjgA1mJou9IsQIul5z3q68KSghMMXRRKLYYTk4PWB MBzzK9d7dm95tIjAKsRhwucI2HTZwi/u7OVGAV57AEz+R3PJ0JrOGcX1bPYOVge3AWg3 mZe14LIpSwU1yZnIhEFK/V8n3ox0cVU83HgAvELSXPmx1nOwNlESZjYxqz10/6vL3PWe rKTQ==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787395765; x=1788000565; darn=freebsd.org; h=content-type:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to:content-type; bh=MPu6t82O9zpTQtTgfwVkvRH/eXKJ8n1ZSUqCHJDW1Eg=; b=YAXr+In5G+10xiopYpg86M+RH90EUZFi4ESWegFgp4v+wnWL/o1LUpGZSdkjRkJT3G dj+XApdu8QLZR/Y19vao0fv8apWn5iqImfMmS2gyAdjpN2Jls+13nmgwkYcKpj2IXoUn ExUtjAL5iPtVLM84bOfWnCr8iMw6JQCMta75Jh3XGv/KTVPsDhb6p8E1hd+gTabeS42B f+lJCcbcRZ7UP0m3E/jni94rT/DcXGNudGiR0eZ1LPZtS5N07+y8qx8Ha738m44KfVSp inEbx1hdMuVGPrD3g26FYpEVd4r1MCVpOxdkYGw19tejuv7mAfRViHJh13NMGX7dodfO rdQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787395765; x=1788000565; h=content-type:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=MPu6t82O9zpTQtTgfwVkvRH/eXKJ8n1ZSUqCHJDW1Eg=; b=ISwPv+NZBNcMNf2RlkAj0q6X94pRiYjSIiAzJ3rdBrTyFj/UbGkUfULBsjtyRibwA2 7IsiUkNJLrgnP/MIRGMUdIXLjNj+63p0V5kVjJG69/4bwWb0+0c4MdEC7/sswEF/suD8 4sSBJZ4AIVceYTnhjFv782hjbUT3NZntNIQFs886WgeVLBmnCCP3Bex77vrzvzubwnGG KIWnv+afHy56pYqkr3XmLONMjyGSB+jglYeD0rdMnfYah6bD/PiaFMKWKlCk+O3jJ7Ty z4cPGFmv5fX94cktKLBp1JiqudbZIZfdaaE79EBBabbd7wAqTJ08i3h4ksXzp8Y8ikWB r5KQ== X-Forwarded-Encrypted: i=1; AHgh+RqlgKOWD3eoZiRElB7jiyWkNbWL4BgGoY77Ys7WvSFCMh9FwzqV0G1YuUc6dAU5xU0gZa+RCuV8tCLVDoeSnlc=@freebsd.org X-Gm-Message-State: AFuF++n4+RbaH/wi1oQ4Hom4fbkLYVRdjBFRkcHPCmAsaGgOo6H9nUjd bRwBu8oV/k1ba/dvY95SWl8wshZH8dQjHYE8pn6m4Yra7aySxtdKUfvdtszSccO8xuvskhQw/DP rcikzUFRVwoTsbhZb5MND0iLmBGdIAfw= X-Gm-Gg: AR+sD127vCYDYWR09dP6ztr2ebUhbsp14xANnbiv8+GPfDZjvAGdsP4CrSgwZVQUHUB cbdzarayRCyCwEFj5axiNvIRGvY0qLgVq9OD1Rtw4gnQwOKHSqBdXyZKWb0s1+1hc6SXkD2ozC4 iurPggl5e4aom/d2NA6oYsjJWWeWTTUX0vdx1Z9e2OuVfwpPIeJCQqjhClPEsmbK7PNTrfmEPf1 g7KEUeBB8Vt9jY7dOd/heu5IzRmTMZEvmi2CAn0dwMIWSrr3zm/hJVFamddRM4u3Y1C9K37VbSO wZrkkzZ+2EBRTMrioWQPAoQC8UtB309FeiyLwswEa9wfHFQP80KRzUnDIDu6u76E5JifoiDZ3Cf 8wT0= X-Received: by 2002:a05:690e:810:20b0:668:99c8:bf15 with SMTP id 956f58d0204a3-66cf209ff92mr1136348d50.11.1787395765049; Sat, 22 Aug 2026 03:49:25 -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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Received: by 2002:a05:7010:2c82:b0:533:77e8:9c45 with HTTP; Sat, 22 Aug 2026 03:49:22 -0700 (PDT) In-Reply-To: References: From: Oliver Pinter Date: Sat, 22 Aug 2026 12:49:22 +0200 X-Gm-Features: AcwNN1XX69OLMYpzxHTIrzeYlYGHk_keo2wrwU34aOxmvzT3AJ5zzsxyEvJc38s Message-ID: Subject: Re: chflags -RL and symlinks pointing outside the traversal: preserve behavior or add a Capsicum guardrail? To: Mark Johnston Cc: Alan Somers , Jitendra Bhati , "freebsd-hackers@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000a61c8d0659a08124" X-Rspamd-Queue-Id: 4hRv7W4x4Wz3R20 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:2607:f8b0::/32, country:US] X-Spamd-Bar: ---- --000000000000a61c8d0659a08124 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Saturday, August 22, 2026, Mark Johnston wrote: > On Sat, Aug 22, 2026 at 12:05:48AM +0200, Oliver Pinter wrote: > > On Wed, Aug 19, 2026 at 6:11=E2=80=AFPM Mark Johnston wrote: > > > > > On Wed, Aug 19, 2026 at 09:40:35AM -0600, Alan Somers wrote: > > > > I vote for #2. Capsicumize the utility, and treat out-of-hierarchy > > > > symlinks as an error. I think that real users will almost never > want to > > > > follow out of hierarchy symlinks. Also, even if this is a POLA > > > violation, > > > > it's extremely rare. With grep, I couldn't find any example of > chflags > > > -RL > > > > in the base system. Github code search turned up a few. Some were > MacOS > > > > Homebrew recipes that invoke chflags right after installing the > package. > > > > Those uses surely would prefer not to follow out-of--hierarchy > symlinks. > > > > The most interesting use I found was from quBSD, a jail/bhyve > manager. I > > > > don't know if that project really intends to follow out-of-hierarch= y > > > > symlinks or not, but I've notified him. > > > > > > If we go this route, I think there does need to be a chicken switch f= or > > > any users that are legitimately impacted and want an easy workaround. > > > I'm not sure what that would look like: an environment variable, > sysctl, > > > new command-line option? Should any such chicken switch be global, > > > i.e., should it apply to all capsicumized utilities which use fts? I > > > presume you are planning to extend this to work with other fts-using > > > utilities which might benefit more from running in a sandbox, like > grep. > > > > > > > What about introducing a sysctl AND a shared page metadata. As far as I > > remember, FreeBSD already has a shared page for gettimeofday(?), > > what about putting the capsicum sysctl state also to the shared page? > > This would save at most one syscall per program invocation, which > doesn't seem expensive enough to justify the complexity. Or am I > misunderstanding something in your proposal. > No, your understanding is fine. The proposal is for the case if someone finds the sysctl to slow or expensive . --000000000000a61c8d0659a08124 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Saturday, August 22, 2026, Mark Johnston <markj@freebsd.org> wrote:
On Sat, Aug 22, 2026 at 12:05:48AM +0200, Oliver Pinter wrote: > On Wed, Aug 19, 2026 at 6:11=E2=80=AFPM Mark Johnston <markj@freebsd.org> wrote:
>
> > On Wed, Aug 19, 2026 at 09:40:35AM -0600, Alan Somers wrote:
> > > I vote for #2.=C2=A0 Capsicumize the utility, and treat out-= of-hierarchy
> > > symlinks as an error.=C2=A0 I think that real users will alm= ost never want to
> > > follow out of hierarchy symlinks.=C2=A0 Also, even if this i= s a POLA
> > violation,
> > > it's extremely rare.=C2=A0 With grep, I couldn't fin= d any example of chflags
> > -RL
> > > in the base system.=C2=A0 Github code search turned up a few= .=C2=A0 Some were MacOS
> > > Homebrew recipes that invoke chflags right after installing = the package.
> > > Those uses surely would prefer not to follow out-of--hierarc= hy symlinks.
> > > The most interesting use I found was from quBSD, a jail/bhyv= e manager.=C2=A0 I
> > > don't know if that project really intends to follow out-= of-hierarchy
> > > symlinks or not, but I've notified him.
> >
> > If we go this route, I think there does need to be a chicken swit= ch for
> > any users that are legitimately impacted and want an easy workaro= und.
> > I'm not sure what that would look like: an environment variab= le, sysctl,
> > new command-line option?=C2=A0 Should any such chicken switch be = global,
> > i.e., should it apply to all capsicumized utilities which use fts= ?=C2=A0 I
> > presume you are planning to extend this to work with other fts-us= ing
> > utilities which might benefit more from running in a sandbox, lik= e grep.
> >
>
> What about introducing a sysctl AND a shared page metadata. As far as = I
> remember, FreeBSD already has a shared page for gettimeofday(?),
> what about putting the capsicum sysctl state also to the shared page?<= br>
This would save at most one syscall per program invocation, which
doesn't seem expensive enough to justify the complexity.=C2=A0 Or am I<= br> misunderstanding something in your proposal.

No, your understanding is fine. The propos= al is for the case if someone finds the sysctl to slow or expensive .
--000000000000a61c8d0659a08124--