-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
nixos/postgresql/citus: fix syscall filter and add test #379769
Conversation
Build failure looks related to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, in #355010 we didn't add a whole new test on purpose - because this won't scale for many extensions. We can't add a new VM test for each of them. But I think we also can't test them together, otherwise the granted exceptions here might overlay each other.
At the same time - we should really test this. So we need a VM test.
I don't really have a solution, but I do think that a VM test for citus
is generally a good idea, especially if we consider that this test could be extended to test multiple machines setting up a citus cluster in the future.
TLDR: I'm OK with adding another test here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right I agree with a multi-node test, but would rather do that on top of master
when staging
is merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also makes me think: I wonder if the hardening should be made more configurable in the module? It seems like extensions could easily hit a blocked syscall after an update and this was difficult to debug for me because there were no logs—I only looked at hardening options because postgresql started fine when run manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like extensions could easily hit a blocked syscall after an update and this was difficult to debug for me because there were no logs
Aren't these logged to the kernel log?
I don't recall where exactly, but I'm pretty sure it's written somewhere - for syscalls at least.
I wonder if the hardening should be made more configurable in the module
See #344925 (comment) for my rationale on why it's implemented the way it currently is.
So, in #355010 we didn't add a whole new test on purpose - because this won't scale for many extensions. We can't add a new VM test for each of them. But I think we also can't test them together, otherwise the granted exceptions here might overlay each other.
Agreed. For the time being, my suggestion would be to add VM tests when the need arises (i.e. when we have to adjust the hardening for instance).
I am building on staging with very low resources allocated - so this might take a while. Will still look at this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully built the test. LGTM from my side.
Thanks y'all |
I figured that it's probably reasonable to backport this to 24.11 as well: #383933 |
This fixes the
citus
extension forpostgresql
. Without this, the database will crash on start because the extension usesgetpriority
andsetpriority
syscalls. The~@privileged @resources
filter breaks those calls. This also adds automated tests forcitus
.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.