From 550da2b75ae4f93152e5f8b870443e71da3f6dd4 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 27 May 2020 16:43:35 +0200 Subject: 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 --- src/vppinfra/bihash_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit 1.2.3-korg