Commit Graph

702853 Commits

Author SHA1 Message Date
Maximilian Bosch
aaeeef5b6c
stdenv: fix custom hardening settings when using __structuredAttrs = true;
Replaces / Closes #353131

A while ago `postgresql` switched to using structured attrs[1]. In the
PR it was reported that this made postgresql notably slower when
importing SQL dumps[2].

After a bit of debugging it turned out that the hardening was entirely
missing and the following combination of settings was the culprit:

    hardeningEnable = [ "pie" ];
    __structuredAttrs = true;

I.e. the combination of custom hardening settings and structured attrs.

What happened here is that internally the default and enabled hardening
flags get written into `NIX_HARDENING_ENABLE`. However, the value is a list
and the setting is not in the `env` section. This means that in the
structured-attrs case we get something like

    declare -ax NIX_HARDENING_ENABLE=([0]="bindnow" [1]="format" [2]="fortify" [3]="fortify3" [4]="pic" [5]="relro" [6]="stackprotector" [7]="strictoverflow" [8]="zerocallusedregs" [9]="pie")

i.e. an actual array rather than a string with all hardening flags being
space-separated which is what the hardening code of the cc-wrapper
expects[3].

This only happens if `hardeningEnable` or `hardeningDisable` are
explicitly set by a derivation: if none of those are set,
`NIX_HARDENING_ENABLE` won't be set by `stdenv.mkDerivation` and the
default hardening flags are configured by the setup hook of the
cc-wrapper[4].

In other words, this _only_ applies to derivations that have both custom
hardening settings _and_ `__structuredAttrs = true;`.

All values of `NIX_HARDENING_ENABLE` are well-known, so we don't have to
worry about escaping issues. Just forcing it to a string by
concatenating the list everytime solves the issue without additional
issues like eval errors when inheriting `env` from a structuredAttrs
derivation[5]. The price we're paying is a full rebuild.

[1] https://github.com/NixOS/nixpkgs/pull/294504
[2] https://github.com/NixOS/nixpkgs/pull/294504#issuecomment-2451482522
[3] cf3e5d3744/pkgs/build-support/cc-wrapper/add-hardening.sh (L9)
[4] cf3e5d3744/pkgs/build-support/cc-wrapper/setup-hook.sh (L114)
[5] 1e84a7fb95
2024-11-02 22:30:01 +01:00
Johannes Jöns
d32fe41821
publicsuffix-list: 0-unstable-2024-09-10 -> 0-unstable-2024-10-25 (#351258) 2024-11-02 14:40:20 +01:00
github-actions[bot]
d6ccd2835b
Merge staging-next into staging 2024-11-02 06:05:06 +00:00
github-actions[bot]
0a375cc4a5
Merge master into staging-next 2024-11-02 06:04:36 +00:00
Robert Schütz
7966d83510
python312Packages.instructor: 1.5.0 -> 1.6.3 (#351795) 2024-11-01 22:45:17 -07:00
Robert Schütz
14fc87c2ab
jellyfin: 10.9.11 -> 10.10.0 (#351966) 2024-11-01 22:30:48 -07:00
Robert Schütz
6eef3d7245
python312Packages.versioningit: don't test with pydantic_1 (#351793) 2024-11-01 22:29:05 -07:00
Robert Schütz
6e38fa8109
python312Packages.hahomematic: 2024.10.14 -> 2024.10.17 (#352476) 2024-11-01 22:25:43 -07:00
Robert Schütz
9bf254235b
vscode-extensions.jroesch.lean: init at 0.16.59 (#352721) 2024-11-01 22:24:39 -07:00
Lin Jian
8190cd6c76
elpa2nix: inline string-empty-p to support Emacs 26 (#352915) 2024-11-02 13:04:45 +08:00
OTABI Tomoya
c013e8c1da
python312Packages.certbot-dns-google: fix build (#352664) 2024-11-02 13:51:39 +09:00
OTABI Tomoya
269d94a536
python312Packages.scikit-misc: 0.4.0 -> 0.5.1 and fix build (#352868) 2024-11-02 13:33:08 +09:00
OTABI Tomoya
c5d18c6785
python312Packages.jiter: 0.5.0 -> 0.6.1 (#352075) 2024-11-02 13:31:17 +09:00
Masum Reza
9b14315707
warp-terminal: 0.2024.10.23.14.49.stable_00 -> 0.2024.10.29.08.02.stable_02 (#352879) 2024-11-02 09:14:40 +05:30
Sandro
a3a8b0fbfb
linux-kernels: fix typo (#353004) 2024-11-02 04:23:08 +01:00
Sandro
6c1691cfb3
bitwarden-directory-connector: 2024.9.0 -> 2024.10.0 (#352799) 2024-11-02 04:22:27 +01:00
R. Ryantm
3e6843e8d5 terraform-providers.google-beta: 6.7.0 -> 6.9.0 2024-11-02 13:20:49 +10:00
Sandro
8cf7063393
mullvad-vpn: 2024.4 -> 2024.6 (#351500) 2024-11-02 03:52:26 +01:00
Peder Bergebakken Sundt
4a597b8ce0
xlsxgrep: drop (#340582) 2024-11-02 03:49:54 +01:00
Theodore Ni
edd7f43442
chrony: switch to apple-sdk_11 (#352910) 2024-11-01 19:12:33 -07:00
Theodore Ni
faf7e114a7
python311Packages.graspologic: relax beartype and hyppo (#353016) 2024-11-01 18:40:58 -07:00
Emily
528225f2d0
oraclejdk_*: mark insecure and not updated (#353034) 2024-11-02 01:31:47 +00:00
Tomo
a50de59140 oraclejdk_*: mark insecure and not updated
https://openjdk.org/groups/vulnerability/advisories/
2024-11-02 01:23:58 +00:00
Theodore Ni
655c5f92a9
python312Packages.meteoswiss-async: relax aiohttp (#353024) 2024-11-01 18:20:04 -07:00
Martin Weinelt
367609fa0a
pinnwand: 1.5.0 -> 1.6.0 (#352869) 2024-11-02 02:19:33 +01:00
Peder Bergebakken Sundt
9a89fd2dd7
spyder: 6.0.1 -> 6.0.2 (#352820) 2024-11-02 01:57:18 +01:00
Adam C. Stephens
1ae562447f
kanidm: update provisioning patches to 1.4.0 (#352857) 2024-11-01 20:27:32 -04:00
Emily
2f832931eb
Revert "NixOS apply script" (#353030) 2024-11-02 00:21:48 +00:00
Will Fancher
37ee6ba681 Revert "NixOS apply script"
Reverts #344407

This has broken nixos-rebuild switch so that it no longer updates the profile, which has bad consequences including not updating the systemd-boot menu with new generations.
2024-11-01 20:18:09 -04:00
github-actions[bot]
5605fc7044
Merge staging-next into staging 2024-11-02 00:14:22 +00:00
github-actions[bot]
e46fdbc115
Merge master into staging-next 2024-11-02 00:14:01 +00:00
Weijia Wang
9e273e5e11
torque: add missing dependency, format, do minor cleanup (#352489) 2024-11-02 01:07:15 +01:00
Weijia Wang
f2d93e4234
python312Packages.gradio: relax aiofiles and markupfiles (#352893) 2024-11-02 01:05:45 +01:00
Weijia Wang
523318b928
ente-auth: fix build failure because of wrong icon path (#352749) 2024-11-02 01:03:42 +01:00
Yt
e8ecffc976
fishPlugins.forgit: 24.10.0 -> 24.11.0 (#352858) 2024-11-01 19:50:37 -04:00
Johannes Jöns
d47871e9fb
telegram-bot-api: 7.10 -> 7.11 (#352843) 2024-11-02 00:44:42 +01:00
Gaétan Lepage
adf93f9ede
zed-editor: 0.159.6 -> 0.159.7 (#352889) 2024-11-02 00:36:17 +01:00
Yt
668e7e6417
Update surrealdb options for v2 (#352681) 2024-11-01 19:31:14 -04:00
Sefa Eyeoglu
c71cae8bbd
mpc: 0.34 -> 0.35 (#347387) 2024-11-02 00:29:08 +01:00
Fabian Affolter
a4bd8993b3 python312Packages.meteoswiss-async: relax aiohttp 2024-11-02 00:28:44 +01:00
Emily
2d6cb731db
lib/licenses: mark watcom as non‐Free (#352608) 2024-11-01 23:19:09 +00:00
Anderson Torres
913fb63484 {mpc_cli,mpc-cli}: red-alias 2024-11-01 20:07:04 -03:00
Anderson Torres
93207b7629 bumblebee-status: update plugins
mpc-cli is now mpc
2024-11-01 20:07:04 -03:00
Anderson Torres
77ec23d6af nixos/tests/mpd: update and format
mpc-cli is now mpc
2024-11-01 20:07:04 -03:00
Anderson Torres
178ea7bbd5 nixos/triggerhappy: update and format
mpc-cli is now mpc
2024-11-01 20:07:03 -03:00
Anderson Torres
bcd149f7a5 clerk: migrate to by-name 2024-11-01 20:07:03 -03:00
Anderson Torres
b1b1176946 clerk: update and format
And fix version
2024-11-01 20:07:03 -03:00
Anderson Torres
ca1ecc03a2 mpc: 0.34 -> 0.35 2024-11-01 20:07:03 -03:00
Anderson Torres
36ecd8606f mpc: refactor
- finalAttrs
2024-11-01 20:07:03 -03:00
Anderson Torres
791efe72af mpc: migrate to by-name
And green-alias mpc-cli.
2024-11-01 20:07:03 -03:00