-
Notifications
You must be signed in to change notification settings - Fork 355
topo: add guard pages around workspaces #1705
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
base: main
Are you sure you want to change the base?
Conversation
e0f3f63 to
0392d14
Compare
|
I don't think this is the direction to go with this, it adds 2GiB of mlocked memory overhead to every wksp which is over like 40GiB. These pages need to stay unmapped. You can make them without paging in by doing mmap(MAP_FIXED) around the prior allocation, not making it bigger. |
f3407a3 to
4599d5c
Compare
|
It seems like workspaces using gigantic pages will naturally be adjacent in vm space. I suspect allocating guard pages will often fail. |
|
I don't think that's true? Workspace addresses are random, due to another security change. |
|
Yeah, this happens in sequence as well, so the other workspaces won't be allocated yet anyway. They will randomize their address until it succeeds. |
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.
.
4599d5c to
d202dcb
Compare
|
Unless I'm doing something wrong this change doesn't appear to work. I checked it out and ran it and there are no guard pages around the workspaces. You can see this by running, eg the below, So it doesn't work but it also silently fails, which is not what we want for security sensitive changes. I would tidy this up and make the error handling clearer and more explicit. |
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.
.
|
I'm also realizing, on the rare occasion that workspaces end up adjacent this code would just fail anyway, rather than making guard pages, since it wouldn't be able to grab the region. You probably will need a |
|
Linux 6.13 has a new feature for this. |
Fixes #989. Prevent overruns from stepping into another workspace by adding guard pages around each workspace.