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

Chaos mode can fail with glibc <= 2.27 and executables with large unmapped regions #3679

Open
rocallahan opened this issue Jan 13, 2024 · 1 comment

Comments

@rocallahan
Copy link
Collaborator

rocallahan commented Jan 13, 2024

This can happen in glibc 2.27:

  • An executable is mapped into memory with a large unmapped hole in it
  • The dynamic linker loads libdl.so into that hole (due to rr chaos mode)
  • Something calls dlopen()
  • dlopen() calls dlopen_doit()
  • dlopen_doit() calls _dl_check_caller, where the caller pointer is some code in libdl.so
  • The first object encountered in the link map is the executable, whose address range contains libdl.so and therefore the caller pointer
  • That executable is not on the list of allowed caller libraries, so _dl_check_caller returns 1 to indicate that the caller is invalid.
  • dlopen() fails.

Fortunately this _dl_check_caller logic was removed in glibc 2.28. Unfortunately there are long-lived systems depending on glibc 2.27 that may not be upgraded for a long time.

@rocallahan
Copy link
Collaborator Author

I'm not sure yet if it's worth doing anything in rr to prevent this.

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