Skip to content

ulimit and W^X #81752

Answered by janvorli
redwyre asked this question in General
Feb 7, 2023 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

@redwyre .NET does not create the file per se, it uses memfd_create("doublemapper", MFD_CLOEXEC). This creates an anonymous file and unlike regular files, it lives in RAM. I was not aware of the fact that it is subject to the ulimit -f limit. So currently, the only way to make it work with that limit is what you have suggested - to disable W^X.
I wonder if we should add honoring the limit though. The limit effectively limits amount of memory that can be used for allocating executable code. In the case someone sets the limit too low, it could result in OOM errors due to that. But maybe that's acceptable.

@mirasrael the #80580 is unrelated, that one is due to another limit - the number of a…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@redwyre
Comment options

@janvorli
Comment options

janvorli Feb 7, 2023
Collaborator

Answer selected by EgorBo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants