From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 1863F385840A for ; Tue, 10 Oct 2023 15:28:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1863F385840A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 1FA6C300B302; Tue, 10 Oct 2023 17:28:34 +0200 (CEST) Received: by r6.localdomain (Postfix, from userid 1000) id D278B34031B; Tue, 10 Oct 2023 17:28:33 +0200 (CEST) Message-ID: Subject: Re: [PATCH 05/16] libelf: Fix elf_end deadlock From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: hsm2@rice.edu Date: Tue, 10 Oct 2023 17:28:33 +0200 In-Reply-To: <20231010134300.53830-5-mark@klomp.org> References: <301fac87e83ebbbd677750579ae9a3429b461bdf.camel@klomp.org> <20231010134300.53830-1-mark@klomp.org> <20231010134300.53830-5-mark@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-3033.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > From: Heather McIntyre >=20 > * libelf/elf_end.c (elf_end): Add rwlock_unlock before > early return. >=20 > Signed-off-by: Heather S. McIntyre > Signed-off-by: Mark Wielaard > --- > libelf/elf_end.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > 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 =3D NULL; > =20 > if (elf->state.ar.children !=3D NULL) > - return 0; > + { > + rwlock_unlock(elf->lock); > + return 0; > + } > } > =20 > /* Remove this structure from the children list. */ This looks obviously correct. All other early returns also release the lock. Thanks, Mark