From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1679589194; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=GC/qxum13au43MhJvvZHMeGUTZKRVjpi3DqGbj9/CjE=; b=ha1M5dx9wVCoGp2PHSYi0piKpgOIuJBq5lXOLlgjJBGTFFDbVhnK3BxUEdT0ykGvxbbfwW X4IfckY9z91TMX8VVyxSCzB8uJHzJ9hqn0MWVe6US94n4VaBdCYi5E3UNaj7Ig/KySAUTp PEWh7tOyc5ZbBgCjaIBo1vx9R3wCVXM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1679589194; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=GC/qxum13au43MhJvvZHMeGUTZKRVjpi3DqGbj9/CjE=; b=YHVouM6hF+/0hOITPcgA7IAXp2zI+XtY0aY+c8gH0PWu7h7TqWNaA0h+nfhoQcmHrAbcRH +XT/aFhE5fq52FAQ== 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) From: Andreas Schwab 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 Content-Type: text/plain 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 List-Id: 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) -- 2.40.0 -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."