Skip to content

lkrg: 0.9.5 -> 0.9.7, switch to finalAttrs#263950

Closed
surfaceflinger wants to merge 2 commits intoNixOS:masterfrom
surfaceflinger:lkrg-0.9.7
Closed

lkrg: 0.9.5 -> 0.9.7, switch to finalAttrs#263950
surfaceflinger wants to merge 2 commits intoNixOS:masterfrom
surfaceflinger:lkrg-0.9.7

Conversation

@surfaceflinger
Copy link
Member

@surfaceflinger surfaceflinger commented Oct 28, 2023

Description of changes

Updated lkrg so it's compatible with 6.1+

Also added a patch to set umh_enforce to 0 by default (but the patch itself has to be applied explicitly). Not sure if it'll be useful but I load lkrg in stage 1 before everything and in this case I think it's the best way of making umh log-only.

Switched to finalAttrs instead of rec because why not.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@surfaceflinger surfaceflinger changed the title lkrg: 0.9.5 -> 0.9.7 lkrg: 0.9.5 -> 0.9.7, switch to finalAttrs Oct 28, 2023
@ofborg ofborg bot requested a review from chivay October 28, 2023 12:18
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Oct 28, 2023
Copy link
Contributor

@OPNA2608 OPNA2608 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result of nixpkgs-review pr 263950 run on x86_64-linux 1

11 packages marked as broken and skipped:
  • linuxKernel.packages.linux_4_19.lkrg
  • linuxKernel.packages.linux_4_19_hardened.lkrg
  • linuxKernel.packages.linux_5_4.lkrg
  • linuxKernel.packages.linux_5_4_hardened.lkrg
  • linuxKernel.packages.linux_latest_libre.lkrg
  • linuxKernel.packages.linux_zen.lkrg
  • linuxPackages_4_19_hardened.lkrg
  • linuxPackages_5_4_hardened.lkrg
  • linuxPackages_latest-libre.lkrg
  • linuxPackages_latest.lkrg
  • linuxPackages_zen.lkrg
13 packages built:
  • linuxKernel.packages.linux_5_10.lkrg
  • linuxPackages_5_10_hardened.lkrg (linuxKernel.packages.linux_5_10_hardened.lkrg)
  • linuxKernel.packages.linux_5_15.lkrg
  • linuxPackages_5_15_hardened.lkrg (linuxKernel.packages.linux_5_15_hardened.lkrg)
  • linuxPackages.lkrg (linuxKernel.packages.linux_6_1.lkrg)
  • linuxPackages_hardened.lkrg (linuxPackages_6_1_hardened.lkrg)
  • linuxKernel.packages.linux_6_5.lkrg
  • linuxPackages_6_5_hardened.lkrg (linuxKernel.packages.linux_6_5_hardened.lkrg)
  • linuxPackages-libre.lkrg (linuxKernel.packages.linux_libre.lkrg)
  • linuxPackages_lqx.lkrg (linuxKernel.packages.linux_lqx.lkrg)
  • linuxPackages_testing_bcachefs.lkrg (linuxKernel.packages.linux_testing_bcachefs.lkrg)
  • linuxPackages_xanmod.lkrg (linuxKernel.packages.linux_xanmod.lkrg)
  • linuxPackages_xanmod_latest.lkrg (linuxKernel.packages.linux_xanmod_latest.lkrg ,linuxPackages_xanmod_stable.lkrg)

All builds pass and changes look okay, but I'm not a user of this kmod so can't comment on the module working correctly, nor do I know how to test it.

I think commit titles should use linuxPackages.lkrg though. A top-level lkrg attribute doesn't exist, so OfBorg doesn't test this. linuxPackages.lkrg should hopefully make it try to build it for the default kernel version.

@patryk4815
Copy link
Contributor

btw: #232099 <- there was open PR for bump, but nobody merge it :(

@chivay chivay mentioned this pull request Nov 6, 2023
12 tasks
unsigned int pcfi_enforce = 1;
unsigned int umh_validate = 1;
-unsigned int umh_enforce = 1;
+unsigned int umh_enforce = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I'm not a fan of this approach.

IMO, it should be handled either by setting appropriate kernel parameters during boot or sysctl config.
Patching the module seems like a last resort when nothing else would work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, I have tried turning it off by cmdline and as far as I remember it didn't work(?) I'll tinker with it further tomorrow, but yeah, I can drop this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got an idea and I'll try generating a patch for p_umh_global on every nix evaluation so umh actually works correctly 😎

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@surfaceflinger 🤔 not sure. Then everytime somebody need recompile module 🤔
Maybe we can write nixosModule for it and use sysctl 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chivay, I talked to @RaitoBezarius and it seems like umh filter will be pointless and mostly problematic with Nix.

We can theoretically patch paths in src but then lkrg would depend on packages like systemd-coredump.

We have 3 options left:

  • Patching out umh like I did above and instead relying on nix trustedusers + noexec for everything that isn't /nix/store
  • Just bumping the version and let others have to turn off umh manually (It doesn't work correctly from end user perspective anyway, 1st option wins over this imo)
  • We take this issue upstream.

If we're going upstream, I think about booting lkrg without umh, list of allowed UMHs would be reported to the interface and then we could switch umh filter on - without option to turn it off
This won't work with nixos-rebuild switch if some umh gets updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filtering module seems to come with a lot of problems, imagine you put in there the Nix store paths and perform an upgrade of NixOS, you need to reload the new kernel module before continuing otherwise all the new usermodehelpers will be broken.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess since we're going to have secureboot in nixpkgs soon, maybe reporting umhs to the module could be done in initrd which would be signed in an UKI

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't have kernel lockdown before we fix the determinism of module signatures, though.

@surfaceflinger surfaceflinger marked this pull request as draft November 7, 2023 01:18
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
@blitz blitz mentioned this pull request Dec 3, 2024
13 tasks
@SuperSandro2000
Copy link
Member

closed in favor of the linked PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants