]> Git Repo - uclibc-ng.git/commitdiff
Fix htab_delete loop counter
authorChristophe Lyon <[email protected]>
Wed, 4 Jul 2018 15:55:41 +0000 (17:55 +0200)
committerWaldemar Brodkorb <[email protected]>
Fri, 10 Aug 2018 14:02:45 +0000 (16:02 +0200)
dlclose can crash or stuck the system:

When calling dlclose() then system can crash or freeze, because
htab_delete() in ldso/ldso/fdpic/dl-inlines.h uses size_t for i which
is a typedef to unsigned int.  We exit the loop on negative value of i
which can never occur since i is an unsigned int. This leads to random
free of various pointers that kill the system.

* ldso/include/inline-hashtab.h (htab_delete): Change type of 'i' to int.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
ldso/include/inline-hashtab.h

index 4a4812027a9a4be69af09c73a53b3ed81a0f4ada..c6c584b0848e1ed6b94dbcd93fe8d2c4ad13a2fa 100644 (file)
@@ -107,7 +107,7 @@ htab_create(void)
 static __always_inline void
 htab_delete(struct funcdesc_ht *htab)
 {
-       size_t i;
+       int i;
 
        for (i = htab->size - 1; i >= 0; i--)
                if (htab->entries[i])
This page took 0.026203 seconds and 4 git commands to generate.