Comments (8)
It's not set up for pages of that size. For example, 16 byte allocations are placed in a slab with 256 slots, which is 4096 bytes. The slab size will be rounded up to 65536 but only the first 4096 bytes will be used. For one thing, all the slot counts need to be redone, but 256 is currently the maximum number of slots with the current implementation. Replacing the array of 4x 64-bit integers with an array of 64x 64-bit integers is not a reasonable approach. It would need to use a multi-level bitmap or another approach.
from hardened_malloc.
The size classes need to be redone for a larger page size. It will be incredibly inefficient doing it that way without redoing it. It would require larger bitmaps for the smallest size classes too.
from hardened_malloc.
The size classes need to be redone for a larger page size. It will be incredibly inefficient doing it that way without redoing it. It would require larger bitmaps for the smallest size classes too.
Ah so it's less of an issue of it breaking software and more of it being inefficient this way?
from hardened_malloc.
It's not set up for pages of that size. For example, 16 byte allocations are placed in a slab with 256 slots, which is 4096 bytes. The slab size will be rounded up to 65536 but only the first 4096 bytes will be used. For one thing, all the slot counts need to be redone, but 256 is currently the maximum number of slots with the current implementation. Replacing the array of 4x 64-bit integers with an array of 64x 64-bit integers is not a reasonable approach. It would need to use a multi-level bitmap or another approach.
That's quite a bit beyond my knowledge, and it does sound like it would need a rewrite.
Thanks for the explanation and quick reply :)
from hardened_malloc.
For what it's worth, I tried using the same ppc64el machine with Debian 12 on a 4K kernel to see if things work and they seem to do. Everything is working as expected, even the single app I have that crashes under x86_64 seems to crash here :p
If this helps this is my environment:
Debian 12 with kernel 6.1.34, stock debian .config except 4K page sizes.
hardened_malloc applied systemwide with the /etc/ld.so.preload method.
vm.max_map_count set to 1048576
KDE desktop (Wayland) with patched QTWebEngine to run apps that depend on it (isn't shipped by default on POWER)
Chromium, Kmail, Neochat, KeePassXC, Elisa, KMyMoney (the only crash as I mentioned), Calibre 5 (backported from Bullseye)
I use a few others here and there but this is just to verify that they work.
The only thing that needs a change in the code is the Makefile to support -mcpu=native instead of -march=native since -march isn't supported on POWER
I'll send a tiny patch that checks if the system is POWER to use -mcpu instead of -march
Thanks again for this awesome code!
from hardened_malloc.
Related Issues (20)
- add safe-unlinking to double-lists HOT 2
- hardned_malloc broken in the CI under clang HOT 1
- Add AArch64 compilation to the CI HOT 1
- Optimizing slab quarantines
- macOS arm64 support HOT 8
- make clean does not delete pycache in test folder HOT 2
- `make clean VARIANT=light` broken HOT 1
- Make use of coverity
- Integrate into AOSP HOT 2
- ping throws a weird error when used with light config HOT 9
- Build broken with `-Wall -ffat-lto-objects` HOT 1
- diehard malloc security improvements are inside hardened malloc? HOT 2
- malloc(0) should allow over-fetching HOT 1
- zero-on-free is the worst possible value HOT 1
- fatal allocator error: failed to allocate slab region arm64 rpi HOT 2
- [linux, question] Error loading shared libraries HOT 2
- Pycharm crashes with using libhardened_malloc HOT 2
- PHP calling __GI___libc_free() HOT 5
- Is this still maintained for Linux (non-Android)? HOT 2
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 hardened_malloc.