-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Project status #1
Comments
Hi, this intends to work how other Rust drop-in memory allocators like mimalloc and jemalloc work. Adding the crate alone will not switch the malloc. This still doesn't work at the moment because:
This has been on my backburner lately because it's annoying to test, but I intend to eventually get it done, and in theory it does work right now if I read the hardened_malloc public API correctly (I didn't use bindgen). Just needs to be linked properly. I'm hoping this project was found just by searching, if it was linked somewhere in a public chat then I'd like what I said here to be mentioned there because it isn't ready or usable right now. |
Okay, that's alright. I guess in the meantime there still is Anyway, what would be the difference to this crate in comparison to using
I was writing up a small server application in rust and thought about how to make it fool-proof, and I knew about hardened-malloc so I was literally just searching for "rust hardened malloc". :) |
@Sir-Photch Got busy and forgot about this issue, but to answer your questions:
From the README of hardened_malloc repo:
It is technically more secure for it to be built into the application at build-time, and can receive the optimisations the compiler and linker produce for that application. You can read the technical details here if you're interested: https://maskray.me/blog/2021-05-09-fno-semantic-interposition A commonly brought up example of malicious LD_PRELOADing is overriding the Obviously being able to disable semantic interposition requires hardened_malloc to be built into the application at build time. But these are why it's always good to build libraries like this into your application at build time instead of LD_PRELOADing.
I would like to do it how other Rust wrapper libraries work by offering a When I find less things to do with my other Rust project, I'll come back to this project and tackle the linking stuff, but I'm confident at least for x86_64 architecture and glibc the bindings I made work (the general userbase of hardened_malloc anyways). musl, Android bionic, and MTE stuff I haven't touched but it would be interesting for me to support the MTE stuff in this library, just would need hardware or an environment to test. |
Hi, have you had the chance to do something about the "Test if this actually works" TODO item?
To be specific, does adding this cargo package make the swich to hardened malloc for a rust's binary memory allocator?
The text was updated successfully, but these errors were encountered: