!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

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

Load older messages


SenderMessageTime
4 Apr 2026
@emilazy:matrix.orgemily heh, that or our Vim package has just had hardeningDisable = [ "fortify" ]; since 2016 🙃 21:12:12
@emilazy:matrix.orgemilyactually since earlier. guessing that's very much not necessary these days21:12:39
@emilazy:matrix.orgemily(actually no 2016 is right, but it was earlier in 2016 than I thought)21:13:06
@emilazy:matrix.orgemily

Fortify hardening detects a probable buffer overflow in vim at runtime. This has to be fixed upstream.

reassuring commit messages…

21:13:22
@esperlily:matrix.orgEsperLily [she/her]is this the right flag to disable for this, or is there a more targeted flag that will do it?21:22:48
@emilazy:matrix.orgemily strictflexarrays1 is more targeted, but it's also a one byte fix to https://github.com/vim/vim/blob/master/src/structs.h#L2017-L2019 to avoid the issue entirely 21:25:00
@emilazy:matrix.orgemilyhttps://github.com/vim/vim/blob/5943c57173e78ce5b5d82d3e908542b010a31134/src/userfunc.c#L723 even goes bizarrely out of its way to avoid depending on the size21:25:22
@emilazy:matrix.orgemily not sure why they're even doing [4] in the first place 21:26:02
@esperlily:matrix.orgEsperLily [she/her] yeah, i just have to wonder why it is defined as [4] and so whether there's any code elsewhere that assumes it's always at least 4 bytes 21:26:06
@esperlily:matrix.orgEsperLily [she/her]my best guess is they want to be able to just compare the first 4 bytes to look for special patterns without having to check if it even has 4 bytes of name21:26:24
@emilazy:matrix.orgemilyusually it's more about padding out the size of the struct from what I've seen, but rarely with any justification of why they'd want to do that21:26:54
@esperlily:matrix.orgEsperLily [she/her] which i guess they could do by declaring it as [] or [0] and then adding the minimum 4 in alloc_ufunc too 21:26:57
@emilazy:matrix.orgemilyhttps://github.com/vim/vim/commit/e01e5215f927f83778ad7494abb0007aa52d08c3 it already got them in hot water with ASAN21:27:04
@emilazy:matrix.orgemily because they were under-allocating 21:27:23
@emilazy:matrix.orgemily as if it was [] 21:27:28
@esperlily:matrix.orgEsperLily [she/her]oops21:27:42
@emilazy:matrix.orgemily [] is C99 and [0] is a GNU extension, which are reasons you might avoid those. but [1] is the very conventional thing to use even in non-GNU C89, hence why -fstrict-flex-arrays=1 allows it too, so it's usually just confusing. but yeah maybe disabling the flag is safer in lieu of upstream fixing it. 21:28:38
@emilazy:matrix.orgemily I expect they're not actually relying on the [4] for anything if they were under-allocating before 2023, but who can say for sure 21:29:13
@emilazy:matrix.orgemilyhttps://github.com/vim/vim/commit/6a12e3342d84a1d754d793ed5019778bd60e749421:29:35
@emilazy:matrix.orgemilywell that's vague21:29:48
@esperlily:matrix.orgEsperLily [she/her]vague but it does imply they were accessing up to 4 bytes of the name without checking21:30:12
@emilazy:matrix.orgemilyyeah, guess it's probably best to disable the flag after all then21:30:19
@emilazy:matrix.orgemilyseems like entirely the wrong place to fix that issue but …21:30:26
@esperlily:matrix.orgEsperLily [she/her] maybe the right solution here is to just copy the same hardeningDisable from vim, it's defined in a common.nix file so it's easy enough to do that 22:14:43
@esperlily:matrix.orgEsperLily [she/her] the only risk there is if like, vim upstream fixes the problem and someone removes fortify from that list before macvim itself has been updated, but since it's been there for a decade then that's not very likely 22:15:42
@emilazy:matrix.orgemily the Vim package should really be doing just strictflexarrays1 there 22:25:14
@emilazy:matrix.orgemilysince it was added for a probably-CVE-worthy bug in 2016 and then never adjusted22:25:25
@emilazy:matrix.orgemilyand makes any future probably-CVE-worthy bugs more exploitable22:25:34
@emilazy:matrix.orgemily so if MacVim has worked fine without it so far, I wouldn't want to spread the fortify there 22:25:44
@emilazy:matrix.orgemily but replacing it with strictflexarrays1 in the Vim package + inheriting that in MacVim sounds sensible 22:25:54

There are no newer messages yet.


Back to Room ListRoom Version: 6