From patchwork Thu Mar 23 16:33:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 66814 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0940C3876892 for ; Thu, 23 Mar 2023 16:33:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0940C3876892 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679589217; bh=GC/qxum13au43MhJvvZHMeGUTZKRVjpi3DqGbj9/CjE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fWGCkadwFo1wZ4uWVsGnKsQcvvJWFr+6m1Aojn23ZQYSFvJdK24l4NjjfNwyGq+zO EnQr72DsNek+uFm0nqDKfkEZRaY7CfsdHtV5j80bD8+7ylESjUnIrq2kwPL8+baFOw nEtBrZ0+8KSaG4OSMe1BMMX2CoMrlkpXbM549Qwo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id E3F97384D18E for ; Thu, 23 Mar 2023 16:33:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3F97384D18E Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 175FB1FE09 for ; Thu, 23 Mar 2023 16:33:14 +0000 (UTC) Received: from hawking.suse.de (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id 185CB2C141 for ; Thu, 23 Mar 2023 16:33:14 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id 0DACD4A0358; Thu, 23 Mar 2023 17:33:14 +0100 (CET) To: libc-alpha@sourceware.org Subject: [PATCH] dlopen: skip debugger notification for DSO loaded from sprof (bug 30258) X-Yow: My polyvinyl cowboy wallet was made in Hong Kong by Montgomery Clift! Date: Thu, 23 Mar 2023 17:33:14 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 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-Patchwork-Original-From: Andreas Schwab via Libc-alpha From: Andreas Schwab Reply-To: Andreas Schwab Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Avoid inconsistent state in the debugger interface. --- elf/dl-load.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elf/dl-load.c b/elf/dl-load.c index 9a0e40c0e9..39c63ff1b3 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1483,6 +1483,10 @@ cannot enable executable stack as shared object requires"); /* Now that the object is fully initialized add it to the object list. */ _dl_add_to_namespace_list (l, nsid); + /* Skip auditing and debugger notification when called from 'sprof'. */ + if (mode & __RTLD_SPROF) + return l; + /* Signal that we are going to add new objects. */ struct r_debug *r = _dl_debug_update (nsid); if (r->r_state == RT_CONSISTENT)