Browse Source

Add MAP_CONCEAL from OpenBSD which has similar purpose but on mmap

call level.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13394)
master
David Carlier 2 years ago
committed by Tomas Mraz
parent
commit
8d4b5260d2
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      crypto/mem_sec.c

+ 4
- 1
crypto/mem_sec.c View File

@ -35,6 +35,9 @@
# if defined(__FreeBSD__)
# define MADV_DONTDUMP MADV_NOCORE
# endif
# if !defined(MAP_CONCEAL)
# define MAP_CONCEAL 0
# endif
# endif
# if defined(OPENSSL_SYS_LINUX)
# include <sys/syscall.h>
@ -471,7 +474,7 @@ static int sh_init(size_t size, size_t minsize)
#if !defined(_WIN32)
# 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
{
int fd;


Loading…
Cancel
Save