mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-07-27 17:15:26 -04:00
use region quarantine even if MAP_FIXED call fails
This is a more sensible way of handling an out-of-memory failure in this edge case. It doesn't matter much in practice.
This commit is contained in:
parent
2335f56713
commit
5c974bdf82
2 changed files with 4 additions and 4 deletions
|
@ -839,10 +839,10 @@ static void regions_quarantine_deallocate_pages(void *p, size_t size, size_t gua
|
|||
}
|
||||
|
||||
if (unlikely(memory_map_fixed(p, size))) {
|
||||
deallocate_pages(p, size, guard_size);
|
||||
return;
|
||||
memory_purge(p, size);
|
||||
} else {
|
||||
memory_set_name(p, size, "malloc large quarantine");
|
||||
}
|
||||
memory_set_name(p, size, "malloc large quarantine");
|
||||
|
||||
struct quarantine_info target =
|
||||
(struct quarantine_info){(char *)p - guard_size, size + guard_size * 2};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue