!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1205 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org201 Servers

Load older messages


SenderMessageTime
5 Apr 2026
@esperlily:matrix.orgEsperLily [she/her] hmm, i don't think so? it looks like hardeningDisable ultimately is just used to remove stuff from the enabledHardeningOptions list, and that turns into the env var NIX_HARDENING_ENABLE. it's possible of course for code to actively suppress any flag not found in that list, but so far i'm not seeing that (e.g. cc-wrapper/add-hardening.sh only takes action on set flags, it doesn't do anything for omitted flags) 02:17:57
@emilazy:matrix.orgemilyfair enough, I may be wrong then02:20:26
@emilazy:matrix.orgemily note that there are multiple levels of _FORTIFY_SOURCE so Vim could be setting them to inferior ones than us 02:20:46
@emilazy:matrix.orgemily and there is no reason to turn it off if our default does not cause issues (which it doesn't, it's strictflexarrays1 that does, so fortify is throwing the baby out with the bathwater somewhat) 02:21:21
@emilazy:matrix.orgemily also, I'm not sure disabling fortify will actually disable strictflexarrays1, so certain fortify settings could still trigger it to break 02:21:58
@emilazy:matrix.orgemily i.e. even if upstream sets it to something that works without strictflexarrays1, it may break in the presence of our injected strictflexarrays1 02:22:12
@emilazy:matrix.orgemily it looks like Vim will only set -D_FORTIFY_SOURCE=1 and only for GCC? 02:24:50
@emilazy:matrix.orgemily unless $GCC is yes in which case uh, it will compare the Clang version to 3 maybe 02:25:18
@emilazy:matrix.orgemilywhat a mess02:25:47
@esperlily:matrix.orgEsperLily [she/her]hmm yeah, this is very messy02:28:08
@emilazy:matrix.orgemily IMO if MacVim has been working fine with our default fortification for years then I'd just disable strictflexarrays1 for both and call it a day 02:29:00
@emilazy:matrix.orgemilyVim is a CVE magnet so I'd be inclined to risk more potential safe-crashes than exploitable bugs02:29:15
@emilazy:matrix.orgemilybut if none have been observed in the accidental experimental group of MacVim users …02:29:35
@emilazy:matrix.orgemily(albeit probably with a tiny sample size)02:29:41
@emilazy:matrix.orgemily the addition of fortify was targeted to one specific bug from 2016 that hadn't yet been fixed upstream so it's only remained out of inertia 02:30:06
@esperlily:matrix.orgEsperLily [she/her] yeah ok fair enough. i guess i'll submit two patches, one which switches macvim to using the common hardeningDisable flags and the other which changes that common definition to strictflexarrays1 and let anyone who cares weigh in on it there 02:31:07
@esperlily:matrix.orgEsperLily [she/her] i am a little nervous about the comment in the configure script that says that _FORTIFY_SOURCE=2 crashes in gcc 4.0, macvim's been running with fortify but that's always been clang and i don't know if clang vs gcc matters for this today 02:34:32
@emilazy:matrix.orgemilyI think the fortify behaviour is pretty uniform. but I could be wrong.02:37:03
@emilazy:matrix.orgemilyat the time GCC 4.0 was released, Vim was presumably full of exploitable memory safety bugs…02:37:18
@emilazy:matrix.orgemilyI imagine a lot more people are running it with hardening flags these days02:37:35
@emilazy:matrix.orgemilywould rather have an abort than a 2005-vintage buffer overflow…02:38:47
@emilazy:matrix.orgemilythose 2020s commits did imply actual ASAN testing was done at some point at least02:38:55
@emilazy:matrix.orgemilyah, they ASAN in CI even.02:39:17
@esperlily:matrix.orgEsperLily [she/her] the configure script tries to strip any _FORTIFY_SOURCE definition already provided, so anyone who sets it through the environment or CLI will be overridden by vim. nixpkgs handles this inside of cc-wrapper but i assume most distributions don't inject flags by wrapping the compiler in a script 02:39:30
@emilazy:matrix.orgemilywell, some distros do stuff like patching GCC spec files02:40:02
@emilazy:matrix.orgemilywhich I think can have a similar effect. (not saying hardening is necessarily done this way002:40:20
@emilazy:matrix.orgemily* which I think can have a similar effect. (not saying hardening is necessarily done this way)02:40:22
@emilazy:matrix.orgemilylooks like Gentoo specifically tries to inject them in spec files02:43:17
@esperlily:matrix.orgEsperLily [she/her] oooh no with just strictflexarrays1 building on aarch64-linux crashes with "buffer overflow detected" 03:13:22
@esperlily:matrix.orgEsperLily [she/her]i wonder if it's worth trying to set the flag depending on which compiler is being used03:13:48

Show newer messages


Back to Room ListRoom Version: 6