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)
- Integ test bloat
- Make S2N_CERT_AUTH_OPTIONAL the default for clients
- Support loading DER-encoded certificates and private keys
- consider adding a default negotiate timeout
- enforce result checking for s2n_stuffer methods
- Unpin dependencies after bumping MSRV beyond 1.70
- add visible debugging information for CI runs
- old libfuzzer used in CI
- old cppcheck used in CI
- Add schannel to integration tests HOT 1
- docs: Rust bindings need an explanation for Send/Sync impls HOT 1
- Add rustls to integration tests HOT 3
- test: SSLv2 integ test
- s2n_tls13_cert_verify_test doesn't run all cases HOT 1
- certificate_signature_preferences field contains unnecessary information HOT 2
- UBSAN triggers on `is_available` getting passed an incorrect function type HOT 5
- version 1.4.5: s2n_shutdown_test fail HOT 2
- clang format all .c and .h files
- make it easier to evaluate the impacts of changing security policies
- Clarify return values of IO APIs in the API documentation
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.