aboutsummaryrefslogtreecommitdiff
path: root/crypto/mem_sec.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/mem_sec.c')
-rw-r--r--crypto/mem_sec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c
index b5f959ba15d5..222c786cbaef 100644
--- a/crypto/mem_sec.c
+++ b/crypto/mem_sec.c
@@ -34,6 +34,12 @@
# include <errno.h>
# endif
# endif
+# if defined(__FreeBSD__)
+# define MADV_DONTDUMP MADV_NOCORE
+# endif
+# if !defined(MAP_CONCEAL)
+# define MAP_CONCEAL 0
+# endif
# include <sys/param.h>
# include <sys/stat.h>
# include <fcntl.h>
@@ -442,7 +448,7 @@ static int sh_init(size_t size, int minsize)
if (1) {
#ifdef MAP_ANON
sh.map_result = mmap(NULL, sh.map_size,
- PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
+ PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE|MAP_CONCEAL, -1, 0);
} else {
#endif
int fd;