-
Notifications
You must be signed in to change notification settings - Fork 72
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
Efficiently allocate memory for secrets in locked pages. #42
Comments
I do not think we should spend time on mlock at this time. It is not used in Parity and because of that is somewhat pointless for our primary use case. I think we should disable it by default and put it on the backburner for now. I'm sure it will become something we'll want to pursue later on. |
I just wanted to have this in an issue instead of a PR discussion, for later. |
@c0gent should we suggest that users disable swap? Ideally swap would be encrypted with a key generated fresh at each boot, making swap a non-issue from a security perspective. Is there a way to set this up? |
Disable their swap files? I'm not sure why we would suggest that. The swap file is only one level in a hierarchy of memory caches so there would still be potential vulnerabilities elsewhere even if it were encrypted. Forgive me if I'm misunderstanding you. |
The swap file is the only one of those caches that persists across reboots, if I understand correctly. |
Issue Status: 1. Open 2. Started 3. Submitted 4. Done This issue now has a funding of 250.0 DAI (250.0 USD @ $1.0/DAI) attached to it.
|
Hi I can do this. Looking at the code I assume the allocator should hold the types that implement the trait
Whatever the decision is, this follow up questions must be answered, too:
Let me know what you think. Also please do note that I can only work on this in my free time, but it shouldn't take too long. |
Any updates? I cannot start with this if your request hasn't been fully clarified. |
Sorry for the slow reply! I was traveling. On a high level, we just want to make sure that secret values are only stored in locked pages and get zeroed after use, ideally without a significant performance hit. Yes, the affected types should mostly be the I'm not sure whether it's an option to make the types hold the allocator as a field. Sure, we could add wrappers for e.g. Yes, if possible I'd use @mbr's code; no need to duplicate the work! Not sure about |
Hello @afck, welcome back. Thank you for clarifying. I will dig through the codebase and come up with a suggestion and PR. |
Hello @afck, in a few weeks I'll start a new job at a new company and I'm currently preparing myself for that position. You can leave this issue assigned to me, but I cannot guarantee you when/if a PR will follow. I'd have to work on this in my free time, which I can do once I get familiar and settled with my new job. Your clarification might be useful to the next person who works on this issue. Thank you for understanding. |
@afck , currently I am working on a blockscout issue, but once that is finished and the PR is accepted I think I'll submit a proposal for this issue. |
Issue Status: 1. Open 2. Cancelled Workers have applied to start work. These users each claimed they can complete the work by 1 year, 8 months ago. 1) veloscillator has applied to start work (Funders only: approve worker | reject worker). Hi all, I'd love to tackle this if still available. I'm an experienced C/C++ dev trying to get more real-world experience with rust by contributing to open source.
Should be able to complete by the end of the weekend. Learn more on the Gitcoin Issue Details page. |
@afck Would be glad to take this on if you could approve ^ the above. |
Sorry, that's not my decision, but @igorbarinov's. |
Issue Status: 1. Open 2. Cancelled The funding of 250.0 SAI (250.0 USD @ $1.0/SAI) attached to this issue has been cancelled by the bounty submitter
|
The currentmlock
functionality—locking each memory page that happens to contain a secret key—causes problems with tests (and possibly also in production) because it quickly reaches the limit of locked memory pages.We need a special allocator that
mlock
s, zeroes andmunlock
s dedicated memory pages and allocates space for secrets in there: locked pages are a scarce resource and should be used exclusively for secrets.See the discussion on #34, specifically #34 (comment), for more details and an initial suggestion of how such an allocator could look.
/cc @mbr, @DrPeterVanNostrand
The text was updated successfully, but these errors were encountered: