0003-Introduce-the-OPENSSL_NO_MADVISE-to-disable-call-to-.patch 889 B

123456789101112131415161718192021222324252627
  1. From 1281ffc7959bd2070563e17a52ee4424196d885c Mon Sep 17 00:00:00 2001
  2. From: Patrick Havelange <patrick.havelange@essensium.com>
  3. Date: Wed, 23 Jan 2019 12:21:21 +0100
  4. Subject: [PATCH] Introduce the OPENSSL_NO_MADVISE to disable call to madvise()
  5. Upstream: https://github.com/openssl/openssl/pull/8089
  6. Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
  7. ---
  8. crypto/mem_sec.c | 2 +-
  9. 1 file changed, 1 insertion(+), 1 deletion(-)
  10. diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c
  11. index 9e0f670..32c7282 100644
  12. --- a/crypto/mem_sec.c
  13. +++ b/crypto/mem_sec.c
  14. @@ -485,7 +485,7 @@ static int sh_init(size_t size, int minsize)
  15. if (mlock(sh.arena, sh.arena_size) < 0)
  16. ret = 2;
  17. #endif
  18. -#ifdef MADV_DONTDUMP
  19. +#if defined(MADV_DONTDUMP) && !defined(OPENSSL_NO_MADVISE)
  20. if (madvise(sh.arena, sh.arena_size, MADV_DONTDUMP) < 0)
  21. ret = 2;
  22. #endif
  23. --
  24. 2.17.1