Bug 32135 - dynamic TLS double-allocated across link namespaces
Summary: dynamic TLS double-allocated across link namespaces
Status: RESOLVED DUPLICATE of bug 24776
Alias: None
Product: glibc
Classification: Unclassified
Component: nptl (show other bugs)
Version: 2.41
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-02 21:12 UTC by Jonathon Anderson
Modified: 2024-09-03 06:35 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
Reproducer (1.01 KB, application/gzip)
2024-09-02 21:12 UTC, Jonathon Anderson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathon Anderson 2024-09-02 21:12:31 UTC
Created attachment 15689 [details]
Reproducer

Dynamic TLS allocated through pthread_key_create or tss_create are not unique if the calls are made in different link namespaces. This means calls to pthread_setspecific/tss_set in one link namespace may overwrite values previously set in another link namespace, and vice versa. Both POSIX and C11 thread interfaces are affected.

Reproducer attached, just run `make`:

    ❯ make
    ...snip...
    ./main-pthread
    [main] Allocated TLS handle: 0
    [main] Set TLS value to: 0x55b0b87b01c9
    [main] Calling into private link namespace...
    [private] Allocated TLS handle: 0
    [private] Set TLS value to: 0x7f6069eaa159
    [main] TLS value is now: 0x7f6069eaa159... FAIL (overwritten)
    ./main-c11
    ...repeats for C11 threads interface...
Comment 1 Florian Weimer 2024-09-03 06:35:01 UTC
Bug 24776 covers other issues as well.

*** This bug has been marked as a duplicate of bug 24776 ***