From patchwork Wed Apr 3 12:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1919299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=f8n668xW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V8kpv6Hwjz23tv for ; Wed, 3 Apr 2024 23:39:51 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B11F6384645B for ; Wed, 3 Apr 2024 12:39:48 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 778233858401 for ; Wed, 3 Apr 2024 12:39:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 778233858401 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 778233858401 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712147973; cv=none; b=B8O3LcocEnB11INg8H44LB7xCienM+tW/LOM3gd1a8x65AJHKJcsnlAC+OFnHG4O4ruOaA4deXKbmnGnr9z6tHXwKbi8aznN0zIq046HuDjt3LeGtgQDbhEXBNlVkf8UeLW184/844CWhnEi3X+QwXtF/vugC/7+IoN679NsvwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712147973; c=relaxed/simple; bh=+Kb5ZDnlL/DXegtAnBUlpVfs+XZGK7OtGicuuVu4Zk4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jkNNqe7/fm+wl3d8jPS3OYq7W7VqrfFhlHx+uAySdKDa9fJieonSazfUGRW4ElNO3WPNHIY9mMLx8TMXCD38LgrhPXHuLUs3eZq7JKIpO54eCSAzk0TYdDn1AfVtkKf+h8cW2H0H71Ied7vjBGY5FU+hsNbJdhPYYu9qGviomeQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1e293335cdeso5006915ad.3 for ; Wed, 03 Apr 2024 05:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712147970; x=1712752770; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=NauNm7nnUddIPXOEqGl1PjFz+zgYSOR1wPYfz5E34Ok=; b=f8n668xW5tLxsYBDcAAWq2QZ8mCqwdUZ8PYYhb/33bquc5J9ocP+xi6iPlB+y+/MKD WV9uPh2VUxvzR1+xPJdbLb3GEvog/rUONinhUWs9SydLxW5Z0LSbhSqYtzK6Hf57cz/x G7Mdrcv4QBCBCgie0naHc7xW63PKPaokiqwN7PjpDk323HMxQlJUXGTR8cMiG1C/XKs1 CIQIR79x5yaCybe7u0cXXEO2mqmENa2BMwRAfmOgVET3g52vhHOU39R9CjzDqDZdF/Uy g9XG8biF4RXQjIfgEepKvsiU4AnohqtEYdJx3X41wS3YC/smBvk1lpblkL4xpqlds5Px 4sVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712147970; x=1712752770; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NauNm7nnUddIPXOEqGl1PjFz+zgYSOR1wPYfz5E34Ok=; b=hGQzImTLDBF4Z0xV4YcrzpXqHc9pD6U0UPsLRwDSL9EQR483EzRWfDaRwhV7vnQNCm dALwwWfsj9Gg4urvG6lO2ca00Xy8on/UQaIoB3XdCY2W4O99cfpyV73+azDQW8Ges7bU UQF1L9ksccfWuJSBLAFSAGpYx15a1n5+VkYR2WOQaoVo+mpPxYDLZ6zmqseWdQ0axe3S eUo7+hlxle8bXB3v7Zp7QiDMXMNqP0XBj3RAg30w+i3k/8s6ozsARC+k5EfJRafwb9mM 4wVqPD+N50pTFDsIg/AAXQ6TYuS0r3U+FIsGeOuS0rKPuNPG4eaqCBOoK7HKmhTkYPWh DiMw== X-Gm-Message-State: AOJu0YwShKfxdqcSTK2oqR//gckLZw0XdWZWZUaPpDpkCxM9eZa5q8ZU 05DmwaMWLXbIVpQejbMur2BbwQC5+OEuib00oergpMVoFlZAjWnOlxgZttYw X-Google-Smtp-Source: AGHT+IHPpAY8CCMmU3LzoqES6bzoDJKNzDV+/vxtK8JibmBesGYwNrkKGZuOXZs1o89wjdCxM03Iag== X-Received: by 2002:a17:903:191:b0:1e0:59f4:a776 with SMTP id z17-20020a170903019100b001e059f4a776mr18472900plg.13.1712147969933; Wed, 03 Apr 2024 05:39:29 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.58.89.72]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b001dd88a5dc47sm13380812plb.290.2024.04.03.05.39.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 05:39:29 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 3941074016D for ; Wed, 3 Apr 2024 05:39:28 -0700 (PDT) From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH] elf: Don't call fatal_error in _dl_signal_error Date: Wed, 3 Apr 2024 05:39:28 -0700 Message-ID: <20240403123928.165033-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3020.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, 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.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Don't call fatal_error in _dl_signal_error since _dl_signal_error should only be called from _dl_catch_exception and get_catch should never return NULL. Otherwise, fatal_error should be called directly instead. --- elf/dl-catch.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/elf/dl-catch.c b/elf/dl-catch.c index 2109516dba..a023555165 100644 --- a/elf/dl-catch.c +++ b/elf/dl-catch.c @@ -117,16 +117,11 @@ _dl_signal_error (int errcode, const char *objname, const char *occasion, if (! errstring) errstring = N_("DYNAMIC LINKER BUG!!!"); - if (lcatch != NULL) - { - _dl_exception_create (lcatch->exception, objname, errstring); - *lcatch->errcode = errcode; + _dl_exception_create (lcatch->exception, objname, errstring); + *lcatch->errcode = errcode; - /* We do not restore the signal mask because none was saved. */ - __longjmp (lcatch->env[0].__jmpbuf, 1); - } - else - fatal_error (errcode, objname, occasion, errstring); + /* We do not restore the signal mask because none was saved. */ + __longjmp (lcatch->env[0].__jmpbuf, 1); } rtld_hidden_def (_dl_signal_error)