3 ms·
How does this work with heap allocation? When you free memory and then allocate it again and get back the same address range, wouldn't the flag still apply to t
by throwaway613834 9y ago
How does this work with heap allocation? When you free memory and then allocate it again and get back the same address range, wouldn't the flag still apply to the new block?
- colmmacc 9y agomadvise() works at the page level and if you're using madvise(), then you're expected to be using mmap() to allocate pages explicitly. It would be unusual and a bad idea to start madvise()ing memory that's being handled by an allocator (like malloc). Of course you could also write a security focused heap allocator that uses these madvise() options under the hood.