Luau retrieve userdata out of Lua State? Does it make sense to propose a RFC for it? #1193
Unanswered
karl-police
asked this question in
Q&A
Replies: 1 comment 1 reply
-
This does not make sense to do. Pointers are not stable across the network boundary or even across runs of the same process on one machine, so they cannot be used as unique identifiers between two processes, let alone two machines. Further, exposing VM internals like this to Luau code runs the risk of allowing malicious code to break out of the Luau sandbox. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Uhhh this is more a question towards Collaborators and etc.
userdata
apparently is stuff on the C API Levelthen there's light userdata. But this is about full userdata, e.g. created C API level Classes or
newproxy()
I was brainstorming around to solve an issue, regarding networking.
One would be the ability to deserialize and serialize userdata.
Whether that is even possible, is another question, userdata may be complex, unlike tables.
The problem I am trying to solve, is to resolve into userdata through a key, without a table. So return userdata based on a pointer.
Point is not to send full userdata from Server to Client. Point is to send a Pointer from Server to Client. This pointer would be used to resolve back into userdata, which can return nil if there is none under that pointer.
Problem would be, security somehow. Basically, being able to resolve pointers allows resolving addresses in memory. 🤷
This is useful to index with classes on both networks, without actually owning the userdata.
If any userdata has a reference in the Lua State Environment, then it should be possible to retrieve it from there too, or not?
e.g. utilizing
lua_touserdata
Beta Was this translation helpful? Give feedback.
All reactions