]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Always exit after machine code page protection change fails.
authorMike Pall <mike>
Sun, 23 Jan 2022 18:16:53 +0000 (19:16 +0100)
committerMike Pall <mike>
Sun, 23 Jan 2022 18:16:53 +0000 (19:16 +0100)
Reported by Sergey Kaplun.

src/lj_mcode.c

index ac37c1a6895ec131a6c84192fc3cc26c641acd18..0a3b3fa3fa37b99110634ec164e28c47fc890a20 100644 (file)
@@ -180,7 +180,7 @@ static void mcode_protect(jit_State *J, int prot)
 #define MCPROT_RUN     MCPROT_RX
 
 /* Protection twiddling failed. Probably due to kernel security. */
-static LJ_NOINLINE void mcode_protfail(jit_State *J)
+static LJ_NORET LJ_NOINLINE void mcode_protfail(jit_State *J)
 {
   lua_CFunction panic = J2G(J)->panic;
   if (panic) {
@@ -188,6 +188,7 @@ static LJ_NOINLINE void mcode_protfail(jit_State *J)
     setstrV(L, L->top++, lj_err_str(L, LJ_ERR_JITPROT));
     panic(L);
   }
+  exit(EXIT_FAILURE);
 }
 
 /* Change protection of MCode area. */