aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-04-17 20:15:22 +0000
committerDave Barach <openvpp@barachs.net>2020-04-20 17:04:29 +0000
commit0e6199dfa20d4c010bf3ac43e051f9f29c213478 (patch)
tree9d5c471e1a7f7e5f0dd9b47bf52661a47a5d116f /src/svm/svm_fifo.h
parent7ce23f25bbc01d534ca294ce88ab0d709e3e03a7 (diff)
svm: check if fifo free list index is valid on alloc
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: BenoƮt Ganne <bganne@cisco.com> Change-Id: Ib85c2f01dc7ec9858f2f88b89e209f989d78c5d9
Diffstat (limited to 'src/svm/svm_fifo.h')
-rw-r--r--src/svm/svm_fifo.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index 0a3d17e42ea..e08b3e9dfa5 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -669,6 +669,8 @@ svm_fifo_size (svm_fifo_t * f)
static inline void
svm_fifo_set_size (svm_fifo_t * f, u32 size)
{
+ if (size > (1 << f->fs_hdr->max_log2_chunk_size))
+ return;
fsh_virtual_mem_update (f->fs_hdr, f->slice_index, (int) f->size - size);
f->size = size;
}