mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-20 05:53:26 +00:00
ibibib
This commit is contained in:
parent
0eaa6f5fe7
commit
29c9b2817f
@ -19,6 +19,10 @@ function clear.clearAllGlobals()
|
|||||||
for k, v in pairs(_G) do
|
for k, v in pairs(_G) do
|
||||||
if not table_contains(WHITELIST, tostring(k)) then _G[k] = nil end;
|
if not table_contains(WHITELIST, tostring(k)) then _G[k] = nil end;
|
||||||
end
|
end
|
||||||
|
_G["k"] = nil
|
||||||
|
_G["v"] = nil
|
||||||
|
_G["WHITELIST"] = nil
|
||||||
|
_G["clearAllGlobals"] = nil
|
||||||
end
|
end
|
||||||
jit.off(table_contains)
|
jit.off(table_contains)
|
||||||
jit.off(clear.clearAllGlobals)
|
jit.off(clear.clearAllGlobals)
|
||||||
|
@ -616,7 +616,6 @@ int init_seccomp()
|
|||||||
return prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) || prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog);
|
return prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) || prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
int random_digit()
|
int random_digit()
|
||||||
{
|
{
|
||||||
@ -651,8 +650,8 @@ int do_something()
|
|||||||
|
|
||||||
|
|
||||||
struct global_var_t {
|
struct global_var_t {
|
||||||
char input_buffer[LUA_MAXINPUT];
|
char input_buffer[LUA_MAXINPUT];
|
||||||
int (*c_functions[C_FUNCTIONS_N]) (void);
|
int (*c_functions[C_FUNCTIONS_N]) (void);
|
||||||
}
|
}
|
||||||
__attribute__ ((aligned (0x10000))) // early optimization rocks
|
__attribute__ ((aligned (0x10000))) // early optimization rocks
|
||||||
global = {{},{random_digit,get_time,do_something,0,0,0,0,0,0,0}};
|
global = {{},{random_digit,get_time,do_something,0,0,0,0,0,0,0}};
|
||||||
@ -681,7 +680,7 @@ int check_safe_func(void* ptr){
|
|||||||
v1 >>= 6;
|
v1 >>= 6;
|
||||||
long long int v2 = ptr-((size_t)((size_t)&main)&~0xffff);
|
long long int v2 = ptr-((size_t)((size_t)&main)&~0xffff);
|
||||||
// TODO: remove
|
// TODO: remove
|
||||||
printf("[DEBUG] v1 = %lld, \tv2 = %lld\n",v1,v2);
|
printf("[DEBUG] v1 = %lld, \tv2 = %lld\n",v1,v2);
|
||||||
return !(v2<0||(0<v1 && v1<31415926)||(ptr == &random_digit || ptr==&do_something || ptr==&get_time));
|
return !(v2<0||(0<v1 && v1<31415926)||(ptr == &random_digit || ptr==&do_something || ptr==&get_time));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user