-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glibc: 2.37-39 -> 2.38-23 #247401
glibc: 2.37-39 -> 2.38-23 #247401
Conversation
Fortification: I stumbled on this in the NEWS
So until this PR we mistakenly built glibc without fortification, if I look right? # The pie, stackprotector and fortify hardening flags are autodetected by
# glibc and enabled by default if supported. Setting it for every gcc
# invocation does not work.
hardeningDisable = [ "fortify" "pie" "stackprotector" ]; /cc @risicle as fortification proponent :-) |
CVE-2023-25139: I re-checked that this had been fixed in glibc-2.37-4 and we had -8 already on 23.05 and later. |
|
Yep, also checked yesterday that this is already applied. Got a bit of a shock before because I thought I've missed a critical rated CVE in glibc for half a year first ;-)
So upstream commit 64d9580cdf7e417170abbef0327e04b29712e949 basically adds required compiler flags into E.g. So unless I missed something, you're right @vcunat. Because of the fixups following the introduction of cc @fpletz who originally added this note 3ba99f8. I know that you did this is quite a few years back, but any chance you still remember the details? AFAIU the autodetection in this commit only affects cc @amjoseph-nixpkgs @trofi just in case you have time, would you mind looking at this? Perhaps I missed somethign and you seem to be more experienced with libc %) |
I wouldn't change anything in 23.05, except possibly update within the 2.37 branch (but I haven't noticed anything important really in there). |
I just rebased the commit to |
@vcunat thanks! Incidentally I started fixing up a bit of stuff yesterday as well and rebased once again, but got distracted while looking at rapidjson ;-) . Anyways, checked that your commit is still fine with the newly rebased state and force-pushed. Shall we await another Hydra evaluation with x86_64-linux only or already build for aarch64-linux already? (Haven't started an eval so far). |
Was the rebase causing a mass rebuild? |
Yes. |
I expect that with your fixes x86_64-linux should be mostly covered, so I triggered aarch64-linux only this time. Most regressions will be shared by the two, I think. And it's not like we need to fix them all, especially not before merging to |
Rebased onto latest staging. We may want to await another Hydra run, but the last jobset eval (1527 failing out of 114243 builds) looked pretty promising, so we could consider merging this later on. |
Sounds like OK to just merge and leave the rest to |
By that we'd also skip #256887 – or at least I hope we already have those security fixes in here as well (TODO: check before merging) |
Oh, you merged it a while ago :-) |
Yeah, I didn't expect such a fast decision and if we would've awaited at least another Hydra round we'd probably had to delay this for at least another staging-next cycle, so I figured having these fixes in master/unstable a little quicker is a good thing %)
I checked, they are. |
Added the change to the release notes for 23.11 since I'm rather certain that we'll get this ready on time this round. @vcunat I'm fine with both awaiting another Hydra round or merging this right away because of how few issues this release seems to have with our packages, so I'd leave this up to you :) |
|
The |
Ah, that issue was unrelated and resolved by PR #257080. Pulling not yet discovered unrelated regressions is the main down-side of basing on |
Ah good to know, was about to test the base of staging because I was surprised that my last push caused the regression %) Anyways, the jobset eval keeps looking good. Do you want me to take a look at another regression we should fix before this lands ins taging? |
The closest comparison I found and used was I believe this is good to include in the upcoming |
@vcunat please note that |
Ah, OK. Anyway, there will most likely be at least a week before this can get into nixpkgs master, so there will be time. We might ping maintainers of regressed packages, too. |
So the problem is that
I'm not entirely sure how TSClibc provides access to libc functions like When starting a Also, I didn't even know that Swift is that much of a thing on Linux. |
That’s probably it. When Swift imports
Swift can import C headers. Types will be mapped over to Swift types, and functions will have a C calling convention. https://developer.apple.com/documentation/swift/imported-c-and-objective-c-apis
It technically is, but the situation isn’t great. There are portability issues between Linux and Darwin due to different Foundation implementations. (There’s a rewrite that should help, but it’s not ready yet.) |
That's the part I was missing. If that happens, then I'm pretty sure we've found the culprit already. That said, given that it's UB to do I skimmed over the bugreports for Swift already and I haven't found a bugreport so far. The problem is that I've seen quite a bunch of codepaths doing essentially Given no bugreports known to me, would you mind filing one against swift describing said problem? If you'd need assistance, let me know! If you want to test things first, you'll probably want to use e016224 as a base since Hydra has built quite a lot for x86_64-linux at least.
To me this sounds like this alone doesn't qualify for a full revert on staging then, though. |
I think I have a patch, but I won’t be able to test it until this evening. They check the return value of
I wouldn’t revert the glibc update just on account of Swift. |
No worries, it's not super time-pressing, the glibc update landed yesterday in staging, so until it'll hit
Yeah I wasn't sure what the easiest fix would be (I've heard that Swift seems to be a decent language, but I've never tried it out so far). Would be cool if you could submit this to upstream as well then :) |
|
|
Description of changes
Even though I managed to get quite far with it already, a Hydra jobset would be helpful to find out if there are notable breakages in any subsystem to be fixed (cc @vcunat).
Announcement: https://sourceware.org/pipermail/libc-alpha/2023-July/150524.html
So far this looks surprisingly good, I managed to build the stdenv on
aarch64-linux
and got up to buildingzfs
andnix
onx86_64-linux
.The patchset is still empty because the latest commit on the release branch is the one the 2.38 tag points to. I added an empty file though to keep things consistent.
Also applied the new version of the DT_HASH fix from ArchLinux[1]. This one's a way easier version than before because it doesn't contain the autoconf changes, but only hardcodes the desired ld flags. It was already confirmed that this patch is sufficient to fix the underlying problem[2].
[1] https://gitlab.archlinux.org/archlinux/packaging/packages/glibc/-/commit/e54d98e2d1aae4930ecad9404ef12234922d9dfd#7b1bfda0391ff4c2662e04a5e193c37e233a0738
[2] ValveSoftware/Proton#6051 (comment)
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)