Skip to content

Detecting GLIBC version (DTLS SIGSEGV). #1322

Open

Description

@InverseRE

The issue was reported before:
#914
#1267
#1170

But seems like, neither of the solutions were implemented.

The main problem here is that the LeakSan can mistakenly detect the glibc version. It detects 2.19 for the real glibc of version 2.25 or higher.
And that causes SIGSEGV later in ScanRangeForPointers function from lsan_common.cc (because DTLS range is illegal).
The condition in DTLS_on_tls_get_addr() function can be false positive: sometimes ((tls_beg % 4096) == sizeof(Glibc_2_19_tls_header)) evaluates to true for pointers from glibc 2.25.

I kindly ask you to do something to avoid these annoying crashes. The LeakSan's code suggests gnu_get_libc_version() in order to limit the supported glibc versions :)

Activity

  1. InverseRE commented on Sep 28, 2020

    @InverseRE
    Author

    Temporarily we disable DTLS with ASAN_OPTIONS=intercept_tls_get_addr=0 to get reports from LeakSan for other storage types.

  2. added a commit that references this issue on Oct 24, 2020
  3. boris-kolpackov commented on Sep 27, 2021

    @boris-kolpackov

    Seeing that this is affecting multiple projects and that no fix seems to be forthcoming, perhaps this test should be disabled by default, at least if using GLIBC?

  4. added a commit that references this issue on May 15, 2022
  5. added a commit that references this issue on May 16, 2022
  6. added a commit that references this issue on May 31, 2022
  7. added a commit that references this issue on Jun 27, 2022
  8. added a commit that references this issue on Jul 12, 2022
  9. added a commit that references this issue on Jul 31, 2022
  10. added a commit that references this issue on Oct 10, 2022
  11. thurstond commented on Apr 18, 2023

    @thurstond
    Contributor

    "Fix tls_get_addr handling for glibc >=2.25" (https://reviews.llvm.org/D147459) landed in LLVM upstream last Friday, which should fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions