[PATCH 05/16] libelf: Fix elf_end deadlock

Mark Wielaard mark@klomp.org
Tue Oct 10 13:42:49 GMT 2023


From: Heather McIntyre <hsm2@rice.edu>

	* libelf/elf_end.c (elf_end): Add rwlock_unlock before
	early return.

Signed-off-by: Heather S. McIntyre <hsm2@rice.edu>
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 libelf/elf_end.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libelf/elf_end.c b/libelf/elf_end.c
index 89727cb3..80f4d13f 100644
--- a/libelf/elf_end.c
+++ b/libelf/elf_end.c
@@ -82,7 +82,10 @@ elf_end (Elf *elf)
       elf->state.ar.ar_sym = NULL;
 
       if (elf->state.ar.children != NULL)
-	return 0;
+	{
+	  rwlock_unlock(elf->lock);
+	  return 0;
+	}
     }
 
   /* Remove this structure from the children list.  */
-- 
2.41.0



More information about the Elfutils-devel mailing list