Warmcat homepage andy@warmcat.com
libwebsockets
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752726604, "reponame":"openssl", "desc":"OpenSSL", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl", "f":3, "items": [ {"schema":"libjg2-1", "cid":"9c46019773995cb9ed8b087bd54cb0ae", "commit": {"type":"commit", "time": 1491476003, "time_ofs": 120, "oid_tree": { "oid": "6d6873ab95908e1b573b609613da1fa3df1e9519", "alias": []}, "oid":{ "oid": "9dfc5b96874c477095f407c08141614e010a0b98", "alias": []}, "msg": "Add support for MLOCK_ONFAULT to secure arena", "sig_commit": { "git_time": { "time": 1491476003, "offset": 120 }, "name": "Andy Polyakov", "email": "appro@openssl.org", "md5": "50bd64fa2a792cbbf679fa16213a3b2a" }, "sig_author": { "git_time": { "time": 1490288182, "offset": -240 }, "name": "Todd Short", "email": "tshort@akamai.com", "md5": "e0436a4477f604d3a4d03268d03fb577" }}, "body": "Add support for MLOCK_ONFAULT to secure arena\n\nReviewed-by: Rich Salz \u003crsalz@openssl.org\u003e\nReviewed-by: Andy Polyakov \u003cappro@openssl.org\u003e\n(Merged from https://github.com/openssl/openssl/pull/3115)\n" , "diff": "diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c\nindex 93bff90..351dec4 100644\n--- a/crypto/mem_sec.c\n+++ b/crypto/mem_sec.c\n@@ -31,6 +31,11 @@\n # include \u003cunistd.h\u003e\n # include \u003csys/types.h\u003e\n # include \u003csys/mman.h\u003e\n+# if defined(OPENSSL_SYS_LINUX)\n+# include \u003csys/syscall.h\u003e\n+# include \u003clinux/mman.h\u003e\n+# include \u003cerrno.h\u003e\n+# endif\n # include \u003csys/param.h\u003e\n # include \u003csys/stat.h\u003e\n # include \u003cfcntl.h\u003e\n@@ -433,8 +438,19 @@ static int sh_init(size_t size, int minsize)\n if (mprotect(sh.map_result + aligned, pgsize, PROT_NONE) \u003c 0)\n ret \u003d 2;\n \n+#if defined(OPENSSL_SYS_LINUX) \u0026\u0026 defined(MLOCK_ONFAULT) \u0026\u0026 defined(SYS_mlock2)\n+ if (syscall(SYS_mlock2, sh.arena, sh.arena_size, MLOCK_ONFAULT) \u003c 0) {\n+ if (errno \u003d\u003d ENOSYS) {\n+ if (mlock(sh.arena, sh.arena_size) \u003c 0)\n+ ret \u003d 2;\n+ } else {\n+ ret \u003d 2;\n+ }\n+ }\n+#else\n if (mlock(sh.arena, sh.arena_size) \u003c 0)\n ret \u003d 2;\n+#endif\n #ifdef MADV_DONTDUMP\n if (madvise(sh.arena, sh.arena_size, MADV_DONTDUMP) \u003c 0)\n ret \u003d 2;\n","s":{"c":1752726604,"u": 28178}} ],"g": 29058,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}