[PATCH v16 2/8] Add generic 'extra TLS'

Florian Weimer fweimer@redhat.com
Sun Jan 12 10:05:28 GMT 2025


* Florian Weimer:

> This goes wrong on aarch64, resulting in a elf/tst-tlsalign-static
> failure:
>
> tdata1 TLS address 0xaaaac60e9014 % 4 = 0
> tdata2 TLS address 0xaaaac60e9010 % 16 = 0
> tdata3 TLS address 0xaaaac60e9000 % 4096 = 0
> tbss1 TLS address 0xaaaac60ea014 % 4 = 0
> tbss2 TLS address 0xaaaac60ea010 % 16 = 0
> tbss3 TLS address 0xaaaac60ea000 % 4096 = 0
> tbss3 value 24 should be 0
>
> Or crash with segmentation fault because rseq_cs is wrong.

I've got a new test case with reproduces this issue reliably even under
GDB, with ASLR disabled.

info: rseq area size: 28
info: checking address ranges with initially loaded modules
info: adding TLS range for "" (4160 bytes)
info: 4 ranges found
error: overlap between address ranges
  TLS for main: [0xfffff7fd8000, 0xfffff7fd903f)
  rseq area: [0xfffff7fd9000, 0xfffff7fd901b)

It's statically linked and has a TLS variable with 4096 bytes.  So
clearly something goes wrong when tcb_offset is very large in
csu/libc-tls.c.

Hopefully from this test it's not going to be too far to the solution …

Thanks,
Florian



More information about the Libc-alpha mailing list