aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/vlib_api_cli.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-04-22 09:02:48 +0200
committerDave Barach <openvpp@barachs.net>2020-04-22 13:03:08 +0000
commit08d01376de5abf2e93c562ee5e24cf62ce1be3ff (patch)
tree5ff125fbf2d79ef432f9f56041fb76e4c00a6fcb /src/vlibmemory/vlib_api_cli.c
parent74ee18b0b33aad974705ae16739a86c48f3b966b (diff)
misc: asan: do not poison memory after munmap()
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>
Diffstat (limited to 'src/vlibmemory/vlib_api_cli.c')
-rwxr-xr-xsrc/vlibmemory/vlib_api_cli.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/vlibmemory/vlib_api_cli.c b/src/vlibmemory/vlib_api_cli.c
index c57f333ba68..5c9762ed70d 100755
--- a/src/vlibmemory/vlib_api_cli.c
+++ b/src/vlibmemory/vlib_api_cli.c
@@ -456,7 +456,6 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename,
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)
@@ -507,7 +506,6 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename,
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
munmap (hp, file_size);
- CLIB_MEM_POISON (hp, file_size);
return;
}
msg += size;
@@ -539,7 +537,6 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename,
{
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;
@@ -563,7 +560,6 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename,
{
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;
@@ -666,7 +662,6 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename,
}
munmap (hp, file_size);
- CLIB_MEM_POISON (hp, file_size);
vec_free (tmpbuf);
am->replay_in_progress = 0;
}