rr-debugger / rr-debugger/rr

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

Open
#3,679 1 comment 0 reactions 0 assignees View on GitHub

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.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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.