diff options
| author | Mike Pall <mike> | 2022-01-23 19:16:53 +0100 |
|---|---|---|
| committer | Mike Pall <mike> | 2022-01-23 19:16:53 +0100 |
| commit | c50232eb320d56d526ba5e6cb5bda8cf5a848a55 (patch) | |
| tree | 9c83ec6bebeb6fe17c1cfac531a79990959fa2e6 | |
| parent | b5b20191f3a8a2e2d28f1362b11bd26a51083d89 (diff) | |
| download | luajit-c50232eb320d56d526ba5e6cb5bda8cf5a848a55.tar.gz luajit-c50232eb320d56d526ba5e6cb5bda8cf5a848a55.tar.bz2 luajit-c50232eb320d56d526ba5e6cb5bda8cf5a848a55.zip | |
Always exit after machine code page protection change fails.
Reported by Sergey Kaplun.
| -rw-r--r-- | src/lj_mcode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_mcode.c b/src/lj_mcode.c index ac37c1a6..0a3b3fa3 100644 --- a/src/lj_mcode.c +++ b/src/lj_mcode.c | |||
| @@ -180,7 +180,7 @@ static void mcode_protect(jit_State *J, int prot) | |||
| 180 | #define MCPROT_RUN MCPROT_RX | 180 | #define MCPROT_RUN MCPROT_RX |
| 181 | 181 | ||
| 182 | /* Protection twiddling failed. Probably due to kernel security. */ | 182 | /* Protection twiddling failed. Probably due to kernel security. */ |
| 183 | static LJ_NOINLINE void mcode_protfail(jit_State *J) | 183 | static LJ_NORET LJ_NOINLINE void mcode_protfail(jit_State *J) |
| 184 | { | 184 | { |
| 185 | lua_CFunction panic = J2G(J)->panic; | 185 | lua_CFunction panic = J2G(J)->panic; |
| 186 | if (panic) { | 186 | if (panic) { |
| @@ -188,6 +188,7 @@ static LJ_NOINLINE void mcode_protfail(jit_State *J) | |||
| 188 | setstrV(L, L->top++, lj_err_str(L, LJ_ERR_JITPROT)); | 188 | setstrV(L, L->top++, lj_err_str(L, LJ_ERR_JITPROT)); |
| 189 | panic(L); | 189 | panic(L); |
| 190 | } | 190 | } |
| 191 | exit(EXIT_FAILURE); | ||
| 191 | } | 192 | } |
| 192 | 193 | ||
| 193 | /* Change protection of MCode area. */ | 194 | /* Change protection of MCode area. */ |
