From nobody Fri Aug 21 00:58:59 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 4hR24q1CRJz6pQPj for ; Fri, 21 Aug 2026 00:59:07 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [IPv6:2001:19f0:7400:8808:12:4:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 4hR24p0Qgcz4Djt for ; Fri, 21 Aug 2026 00:59:05 +0000 (UTC) (envelope-from jamie@catflap.org) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=catflap.org; spf=pass (mx1.freebsd.org: domain of jamie@catflap.org designates 2001:19f0:7400:8808:12:4:0:1 as permitted sender) smtp.mailfrom=jamie@catflap.org X-Catflap-Envelope-From: X-Catflap-Envelope-To: freebsd-hackers@FreeBSD.org Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [209.250.224.51]) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5) with ESMTP id 67L0wxKe078933; Fri, 21 Aug 2026 01:59:00 +0100 (BST) (envelope-from jamie@donotpassgo.dyslexicfish.net) Received: (from jamie@localhost) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5/Submit) id 67L0wxCv078932; Fri, 21 Aug 2026 01:58:59 +0100 (BST) (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <202608210058.67L0wxCv078932@donotpassgo.dyslexicfish.net> Date: Fri, 21 Aug 2026 01:58:59 +0100 Organization: Dyslexic Fish To: jitendrabhati2026@gmail.com, freebsd-hackers@FreeBSD.org Subject: Re: chflags -RL and symlinks pointing outside the traversal: preserve behavior or add a Capsicum guardrail? References: In-Reply-To: User-Agent: Heirloom mailx 12.4 7/29/08 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (donotpassgo.dyslexicfish.net [209.250.224.51]); Fri, 21 Aug 2026 01:59:00 +0100 (BST) X-Spamd-Result: default: False [-2.68 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.982]; DMARC_POLICY_ALLOW(-0.50)[catflap.org,none]; R_SPF_ALLOW(-0.20)[+mx:dyslexicfish.net]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:20473, ipnet:2001:19f0:7400::/38, country:US]; HAS_ORG_HEADER(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com,FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEFALL_USER(0.00)[jamie]; MLMMJ_DEST(0.00)[freebsd-hackers@FreeBSD.org]; R_DKIM_NA(0.00)[] X-Rspamd-Queue-Id: 4hR24p0Qgcz4Djt X-Spamd-Bar: -- Jitendra Bhati wrote: > Options: > > Keep -L as-is (path-based, not confined) - current PR behavior. > Capsicumize -L too, and treat out-of-hierarchy symlink targets as an error. > Capsicumize -L but keep out-of-hierarchy targets working by opening a > descriptor for the resolved target's parent (loses most of the confinement > benefit for -L). > > I lean toward (1) for this PR and revisiting -L separately, but I'd > appreciate opinions on whether the stricter behavior is worth the > compatibility break. I make no comment one way or the other on capsium, or changing to openat, but I've always thought the option to follow symbol links like this was useless. I can never see a case where you'd want to use such an option, and it does open potebtial security holes. But it's not just chflags, it's the same with many commands with recursive options (e.g. chmod and chown) I'd also extend the same philosophy to the non-recursive versions of these commands: '-h' should be the default for all these too, but I guess that ship has sailed. Cheers, Jamie