It is a bad idea to poison memory after munmap because the address space
can be reused (eg. for global data of dlopen()ed object) and ASan model
allows access by default.
Moreover, access to a stale address space will fault.
Type: fix
Change-Id: I356de422f255447d9d50a3a71fb0c2eaa790d731
Signed-off-by: Benoît Ganne <bganne@cisco.com>
if (munmap (pm->perf_event_pages[i][my_thread_index],
pm->page_size) < 0)
clib_unix_warning ("munmap");
if (munmap (pm->perf_event_pages[i][my_thread_index],
pm->page_size) < 0)
clib_unix_warning ("munmap");
- CLIB_MEM_POISON (pm->perf_event_pages[i][my_thread_index],
- pm->page_size);
pm->perf_event_pages[i][my_thread_index] = 0;
}
pm->perf_event_pages[i][my_thread_index] = 0;
}
vlib_cli_output (vm, "Range (%d, %d) outside file range (0, %d)\n",
first_index, last_index, nitems - 1);
munmap (hp, file_size);
vlib_cli_output (vm, "Range (%d, %d) outside file range (0, %d)\n",
first_index, last_index, nitems - 1);
munmap (hp, file_size);
- CLIB_MEM_POISON (hp, file_size);
return;
}
if (hp->wrapped)
return;
}
if (hp->wrapped)
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
munmap (hp, file_size);
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
munmap (hp, file_size);
- CLIB_MEM_POISON (hp, file_size);
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
munmap (hp, file_size);
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
munmap (hp, file_size);
- CLIB_MEM_POISON (hp, file_size);
vec_free (tmpbuf);
am->replay_in_progress = 0;
return;
vec_free (tmpbuf);
am->replay_in_progress = 0;
return;
{
vlib_cli_output (vm, "Ugh: msg id %d no endian swap\n", msg_id);
munmap (hp, file_size);
{
vlib_cli_output (vm, "Ugh: msg id %d no endian swap\n", msg_id);
munmap (hp, file_size);
- CLIB_MEM_POISON (hp, file_size);
vec_free (tmpbuf);
am->replay_in_progress = 0;
return;
vec_free (tmpbuf);
am->replay_in_progress = 0;
return;
}
munmap (hp, file_size);
}
munmap (hp, file_size);
- CLIB_MEM_POISON (hp, file_size);
vec_free (tmpbuf);
am->replay_in_progress = 0;
}
vec_free (tmpbuf);
am->replay_in_progress = 0;
}
clib_mem_vm_free (void *addr, uword size)
{
munmap (addr, size);
clib_mem_vm_free (void *addr, uword size)
{
munmap (addr, size);
- CLIB_MEM_POISON (addr, size);