Chaos mode can fail with glibc <= 2.27 and executables with large unmapped regions
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.7k
- Forks
- 662
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 2
Description
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.sointo that hole (due to rr chaos mode) - Something calls
dlopen() dlopen()callsdlopen_doit()dlopen_doit()calls _dl_check_caller, where thecallerpointer is some code inlibdl.so- The first object encountered in the link map is the executable, whose address range contains
libdl.soand therefore thecallerpointer - That executable is not on the list of allowed caller libraries, so
_dl_check_callerreturns 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing rr's chaos mode around executable mapping and reproducing the sequence through dlopen(), dlopen_doit(), and glibc's _dl_check_caller on glibc <=2.27. Confirm the failure described in the issue, then verify that dlopen() succeeds for executables with large unmapped regions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100