Skip to content
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

Safety against obtaining function pointers to functions removed by dlclose? #27

Open
jgarvin opened this issue Jul 22, 2020 · 0 comments

Comments

@jgarvin
Copy link

jgarvin commented Jul 22, 2020

A dastardly user could:

  • Write a function that returns a function pointer to itself
  • Put that function inside a shared library
  • dlopen the library
  • Call the function
  • Store the returned fn
  • Call dlclose on the library
  • Try to call the fn. Boom?

Does the crate have anything to prevent this? I see the Symbol types that are trying to ensure you only call a function if it's still loaded as long as you are going through them, but it seems like it's possible for users to circumvent by having functions that return function pointers, but I'm still new to Rust and I haven't actually tried coding this up so I could be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant