vppinfra: fix SIGBUS in bihash init when running unpriviledged 26/27226/1
authorDamjan Marion <damarion@cisco.com>
Sun, 24 May 2020 18:43:10 +0000 (20:43 +0200)
committerDamjan Marion <damarion@cisco.com>
Sun, 24 May 2020 18:45:15 +0000 (20:45 +0200)
Obserbed when VPP is running in k8s container.

Type: fix
Change-Id: Ibbff9c3921bd7f4f97d47cb6f10eed8ed5efe269
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/vppinfra/bihash_template.c

index 47e9bd0..2305436 100644 (file)
@@ -38,7 +38,7 @@ static inline void *BV (alloc_aligned) (BVT (clib_bihash) * h, uword nbytes)
       void *base, *rv;
       uword alloc = alloc_arena_next (h) - alloc_arena_mapped (h);
       int mmap_flags = MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS;
-      int mmap_flags_huge = (mmap_flags | MAP_HUGETLB |
+      int mmap_flags_huge = (mmap_flags | MAP_HUGETLB | MAP_LOCKED |
                             BIHASH_LOG2_HUGEPAGE_SIZE << MAP_HUGE_SHIFT);
 
       /* new allocation is 25% of existing one */