Comments (6)
Looks unlock might not be enough. mlock is controlled by RLIMIT_MEMLOCK (ulimit -l). Ubuntu is setting this to 64 KB (even for root). If the total locked memory exceeds this mlock will fail.
Increasing the limit will avoid this problem. However, this may not be feasible in all situations.
Also, the FreeBSD documentation above says that use of mlock can be restricted to super-user only.
This relates to this OpenVPN bug, https://community.openvpn.net/openvpn/ticket/293 also discussed at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=406895
from s2n-tls.
Test case https://gist.github.com/user-none/6c627e97f65a31c5bc1e . keeps calling s2n_config_new until an out of memory error occurs. As stated n the gist valgrind showed 34,977 bytes allocated.
Commenting out the mlock if statement in utils/s2n_mem.c the test passes.
from s2n-tls.
Is it that the limit may not even be raised for/by root? On my system I can raise the limit arbitrarily, but I'm also running a custom kernel and am not certain what parts are custom.
from s2n-tls.
Root can raise the limit. On Ubuntu by default only root can raise the
limit. It is also possible to have it raised permanently the same as other
limits.
Think of s2n being used in s client application like a we browser. Any one
wanting to use the application will need to reconfigure the OS. Personally,
if I were told I needed to start changing OS level settings in order to use
something like a web browser I'd look for a different web browser.
Not everyone may be able to raise the limit. A university computer lab for
example. Students would not have access to make this change.
On Friday, July 3, 2015, Colm MacCárthaigh [email protected] wrote:
Is it that the limit may not even be raised for/by root? On my system I
can raise the limit arbitrarily, but I'm also running a custom kernel and
am not certain what parts are custom.—
Reply to this email directly or view it on GitHub
#108 (comment).
from s2n-tls.
@BigBoneDaddy root can change the limit permanently for users but it still
needs to be done manually.
Also, don't forget that this prevents the applications memory from being
written to swap. So even with the limit removed you can still have an out
of memory condition if physical memory is exhausted even when it wouldn't
happen because swap is available.
On Friday, July 3, 2015, BigBoneDaddy [email protected] wrote:
@user-none https://github.com/user-none Good points I would NEVER run
my internet web browser as root too that would be insane in the membrane!—
Reply to this email directly or view it on GitHub
#108 (comment).
from s2n-tls.
I think #200 #195 should fix this. You can set the env var S2N_DONT_MLOCK if you aren't interested/able to increase the memlock limit.
from s2n-tls.
Related Issues (20)
- s2n-tls binding close behavior
- bug: s2n_handshake_type_set_tls12_flag causes TLS1.3 codepath to fail
- cleanup: Change tests to use new testlib function
- Support configurable s2n blinding delay HOT 2
- Investigate packing and alignment for internal/opaque structs
- Runtime instead of compile time support check for curves
- Unpin dependencies after bumping MSRV beyond 1.72
- Organize rust bindings dependency pins into single issue HOT 2
- Send zero-length TLS1.2 NewSessionTicket message if necessary
- Run tests on Ubuntu 24.04 in CI
- Migrate CI to Ubuntu 24 HOT 1
- Purge old priority labels HOT 1
- 6 tests failing with Error Message: 'Certificate is untrusted' when compiling on RHEL 9 HOT 7
- Avoid storing signature schemes in a separate buffer HOT 1
- Reuse MAC writing logic in s2n_record_read
- add documentation for non-vendored rust bindings
- Add interoperability test for latest oqs-provider
- add "minimal test" option for binding generation
- add support for linking multiple copies of s2n-tls in an application HOT 2
- Nix: Amazon Corretto install on arm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s2n-tls.