Always exit after machine code page protection change fails.

Reported by Sergey Kaplun.
master
Mike Pall 2022-01-23 19:16:53 +01:00
parent b5b20191f3
commit c50232eb32
1 changed files with 2 additions and 1 deletions

View 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. */