Comments (8)
It's already supported via the malloc_object_size APi and it's up to libc if it wants to use it.
from hardened_malloc.
snmalloc provides it natively, without having to have the libc support it.
from hardened_malloc.
Would such a mitigation prevent any more attacks than the slab canaries already do?
from hardened_malloc.
This would catch corruption before it happens, while slab canaries are only detecting it maybe at some point.
But with MTE, it's kinda useless I think.
from hardened_malloc.
@jvoisin Yeah, it's useless with MTE, but we support platforms without MTE so it would make sense to address as a low priority feature.
from hardened_malloc.
It adds a fair share a complexity:
memcpy_guarded>:
mov rax,QWORD PTR [rip+0xbfa] # Load Chunk map base
test rax,rax # Check if chunk map is initialised
je DONE # |
mov rcx,rdi # Get chunk map entry
shr rcx,0xa # |
and rcx,0xfffffffffffffff0 # |
mov rax,QWORD PTR [rax+rcx*1+0x8] # Load sizeclass
and eax,0x7f # |
shl rax,0x5 # |
lea r8,[sizeclass_meta_data] # |
mov rcx,QWORD PTR [rax+r8*1] # Load object size
mov r9,QWORD PTR [rax+r8*1+0x8] # Load slab mask
and r9,rdi # Offset within slab
mov rax,QWORD PTR [rax+r8*1+0x10] # Load modulus constant
imul rax,r9 # Perform recripocal modulus
shr rax,0x36 # |
imul rax,rcx # |
sub rcx,r9 # Find distance to end of object.
add rcx,rax # |
cmp rax,rdx # Compare to length of memcpy.
jb ERROR # |
DONE:
jmp <memcpy>
ERROR:
ud2 # Trap
I'm not sure it's worth the hassle.
from hardened_malloc.
Related Issues (20)
- 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
- Different page size support HOT 8
- Build Error HOT 1
- Integrate Hardened malloc into ROM HOT 2
- Lastpass HOT 16
- Add all currently supported clang versions in the CI
- [Question][Android] How to use for debugging? HOT 2
- Build issue on Rocky Linux 9 aarch64 HOT 4
- Double-free result in hang on android HOT 8
- RLIMIT_AS HOT 1
- Packaging for desktop linux distributions HOT 1
- Is hardened malloc or the like potentally causing problems with WebInstaller/WebUSB? HOT 1
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.