Comment 12 for bug 1863162

Revision history for this message
In , Pádraig Brady (p-draigbrady) wrote :

We found an off by one issue with this (with ASAN + certain number of shared libs). When the last vector in the _dl_allocate_tls_init list of vectors was of size one it would have been skipped. The fix is:

diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 073321c..2c9ad2a 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -571,7 +571,7 @@ _dl_allocate_tls_init (void *result)
        }

       total += cnt;
- if (total >= dtv_slots)
+ if (total > dtv_slots)
        break;

       /* Synchronize with dl_add_to_slotinfo. */