summaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-10-20 14:31:55 +0200
committerDamjan Marion <dmarion@me.com>2020-10-21 11:04:07 +0000
commitdf601ae2d16ed127a9506a7a865484632ee1afe1 (patch)
tree6cd0860085ae9b74dbe5b41227541b3f4912fe63 /src/svm/svm_fifo.c
parent568617bfe6d45c0ebe0f4eb45fdaca6a3a90134e (diff)
svm: fix ASAN annotations for external chunks
Chunks can be allocated from another process. We need to manually mark them as accessible for ASAN. Type: fix Change-Id: Ifbeef3346e9cee2c1231f80cbcf7f9673b5b54be Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/svm/svm_fifo.c')
-rw-r--r--src/svm/svm_fifo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c
index 22cb64eb475..d49cbe2bf7d 100644
--- a/src/svm/svm_fifo.c
+++ b/src/svm/svm_fifo.c
@@ -70,6 +70,8 @@ CLIB_MARCH_FN (svm_fifo_copy_from_chunk, void, svm_fifo_t * f,
c = c->next;
while ((to_copy -= n_chunk))
{
+ CLIB_MEM_UNPOISON (c, sizeof (*c));
+ CLIB_MEM_UNPOISON (c->data, c->length);
n_chunk = clib_min (c->length, to_copy);
clib_memcpy_fast (dst + (len - to_copy), &c->data[0], n_chunk);
c = c->length <= to_copy ? c->next : c;
@@ -1054,6 +1056,7 @@ svm_fifo_peek (svm_fifo_t * f, u32 offset, u32 len, u8 * dst)
len = clib_min (cursize - offset, len);
head_idx = head + offset;
+ CLIB_MEM_UNPOISON (f->ooo_deq, sizeof (*f->ooo_deq));
if (!f->ooo_deq || !f_chunk_includes_pos (f->ooo_deq, head_idx))
f_update_ooo_deq (f, head_idx, head_idx + len);