-
Notifications
You must be signed in to change notification settings - Fork 4
#40 - Implement safeCall to spoof the stack #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
packages/autorun-env/src/functions/auth/hooks/lj_debug_funcname.rs
Outdated
Show resolved
Hide resolved
packages/autorun-env/src/functions/auth/hooks/lj_debug_funcname.rs
Outdated
Show resolved
Hide resolved
This one is funny because it can also leak Autorun's presence in the stack.
It sucks that its a constant, but since I now force all the call frames to generate (including the closure wrapper), there's an extra two now.
|
There were some problems with adjusting to the new call frames introduced by Here are some test results (method of test is some function that somehow lets you run arbitrary code in Autorun's context, the worst-case scenario): ProtectedUnprotected |
|
Ready for review. Also would be nice if you could test this branch @thevurv . You should be able to load a map like usual, and it shouldn't crash.. hopefully. |
|
also do not merge yet cause it's still quite experimental but I requested a review to get rid of any major blockers |
Now, we default to zero for any native errors. This is in line with GMod, which does the same and this is why native errors never have a source attached.
|
Starting to notice crashes and general instability... keeping as draft for now |

Resolves #40
Resolves #43
Changes
protections.luathat installs a few necessary and critical safe-call wrappers to protect Autorun. This is NOT something related to Safety Equivalent #10 .lj_debug_funcnameto frame stitch the original call stack and restores proper errors for fast functions without anything unusual happening.pcall_forwardanderrorto LuaApi which enables Autorun to finally error properly in the proper format expected without anything seeming off. The detour handler now forwards these errors properly, so erroring inside of a detour functions as expected.LuaApi,luaL_where,lua_concatandlua_removeExample for the new error handling:
Source:
It is a bit cumbersome to need to use the global variant of error, but we can't use the typical error or else it will bypass the safe calling mechanism and violate new assumptions held by the hooks and such.