diff options
author | David Carlier <devnexen@gmail.com> | 2020-11-13 10:16:55 +0000 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2020-12-08 18:27:07 +0100 |
commit | 8d4b5260d22cc05894d606edd6cfc524661ab6e9 (patch) | |
tree | c9a72f4ee7376ec9c7b5ca8104282c487c2c8b84 /crypto | |
parent | 27db6118722a8af928aa6e4d1be865fa46fb0f0c (diff) |
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)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/mem_sec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c index f27a759f17..cc4c4e08f6 100644 --- a/crypto/mem_sec.c +++ b/crypto/mem_sec.c @@ -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; |