aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/bihash_template.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-05-27 16:43:35 +0200
committerDamjan Marion <damarion@cisco.com>2020-05-27 16:43:35 +0200
commit6183cf4fb90744675b6d4b606b90b57250c724de (patch)
tree57b02c6b7cc986efebc174df63edbcdb5be4add1 /src/vppinfra/bihash_template.c
parent11492291e660bcf0a362943b49b7854b4510e94c (diff)
vppinfra: fix SIGBUS in bihash init when running unpriviledged, take two
Looks like MAP_LOCK is not enough, so call mlock(...) instead.... Type: fix Change-Id: I1bc668a2bf3c861ca1c2d376c0fb6bfea87d4f48 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/bihash_template.c')
-rw-r--r--src/vppinfra/bihash_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vppinfra/bihash_template.c b/src/vppinfra/bihash_template.c
index 2305436dca2..dac42a8dc14 100644
--- a/src/vppinfra/bihash_template.c
+++ b/src/vppinfra/bihash_template.c
@@ -53,7 +53,7 @@ static inline void *BV (alloc_aligned) (BVT (clib_bihash) * h, uword nbytes)
rv = mmap (base, alloc, PROT_READ | PROT_WRITE, mmap_flags_huge, -1, 0);
/* fallback - maybe we are still able to allocate normal pages */
- if (rv == MAP_FAILED)
+ if (rv == MAP_FAILED || mlock (base, alloc) != 0)
rv = mmap (base, alloc, PROT_READ | PROT_WRITE, mmap_flags, -1, 0);
if (rv == MAP_FAILED)