From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id BEEF93858D28 for ; Sat, 18 Dec 2021 18:59:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BEEF93858D28 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-538-okT3gn13PIeufHypFJ7eNA-1; Sat, 18 Dec 2021 13:59:07 -0500 X-MC-Unique: okT3gn13PIeufHypFJ7eNA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E6DB344AF; Sat, 18 Dec 2021 18:59:06 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 02D1545D9B; Sat, 18 Dec 2021 18:59:03 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org, John Mellor-Crummey , Ben Woodard Subject: Re: [PATCH v6 12/20] elf: Do not fail for failed dlmopen on audit modules (BZ #28061) References: <20211115183734.531155-1-adhemerval.zanella@linaro.org> <20211115183734.531155-13-adhemerval.zanella@linaro.org> Date: Sat, 18 Dec 2021 19:59:01 +0100 In-Reply-To: <20211115183734.531155-13-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Mon, 15 Nov 2021 15:37:26 -0300") Message-ID: <87czlthh8q.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2021 18:59:11 -0000 * Adhemerval Zanella: > The dl_main() sets the LM_ID_BASE to RT_ADD just before starting to > add load new shared objects. The state is set to R_CONSISTENT just > after all objects are loaded. > > However if a audit modules tries to dlmopen() an inexistent module, > the _dl_open() will assert that the namespace is in an inconsistent > state. > > This is different than dlopen(), since first it will not use > LM_ID_BASE and second _dl_map_object_from_fd() is the sole responsible > to set and reset the r_state value. > > So the assert() on _dl_open() can not really be seen if the state is > consistent, since _dt_main() resets it. This patch removes the assert. See previous comments about (). > diff --git a/elf/dl-open.c b/elf/dl-open.c > index e2f2e713e7..4f4d72e325 100644 > --- a/elf/dl-open.c > +++ b/elf/dl-open.c > @@ -914,8 +914,6 @@ no more namespaces available for dlmopen()")); > the flag here. */ > } > > - assert (_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT); > - _dl_debug_update has already been called for its side effect above, so deleting the line is fine. Reviewed-by: Florian Weimer Thanks, Florian