From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id D98573858430 for ; Mon, 8 Apr 2024 17:18:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D98573858430 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D98573858430 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::432 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712596729; cv=none; b=qcHyBsI5FlUKl4sP9EOuWNKbEqWvXJo0FFRrUEJvTPuGBpD6mly1cHUeXXXFz05i7x/60K+QN79GX/dFKReVup1EIxFr222v/YwCfLFN+Ha/wuecYHgnG/KoHC4NCWAZ/VyVpHQRQ266ibe3PEyxq2yA24wY+1HmLmqYEerh06c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712596729; c=relaxed/simple; bh=aIEju1Awg0RwEX3YIxGxx9NePc4WQ3HRnZoWE1pPz9s=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=kjN3uZrYTGsIZl0/bFIPpbtcW6MEXjKY04vNlDr8P1z06N4RxuD3jxbAVVP+0e6EvOQD07thy31IHbbbZ5WQ/Jn+TBWIV26sS3YOCAzYMfXGDL563py4LHVFrmx5N7rWPcXGbF6PCTQ3T4M3SrljDxAk8FPKm8OwXdlEIQukn3U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6ecec796323so4346340b3a.3 for ; Mon, 08 Apr 2024 10:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712596727; x=1713201527; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=kQTcGuHmpMjEjf5xxbhVNdSz5OziCcGeed0sLrFFG50=; b=OaIKbff3u4TYCE1yKPho7bCEo21yDWINjx2pzwJSwUlTqcyC5X7wCZyGIgKqREW5aq jDIchA1BRHlPiMDia6V6wDQ0ysSXx6OVGgKAQY80V3kHJwejJCCIAKhSDgAlQ+E6diba d5u7AKFF2+gGhLqL1nFHn2eHVDiHKF/upmzNS7ivM4vTfCD4DZfgvZ/9JuxY/Gq21qi9 HCGsRavyz/bslb8IyLFIIGprl3wFGqie9M2lSWBNNK2a/exglRFm+9QYnYcg923GsEiB 74ULL/ydSxM69hvd398BkfdN8R4FxyfPwwUY74xtkCG6vnlUWo0K8cAcxxZfkSt8mcmU MHjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712596727; x=1713201527; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kQTcGuHmpMjEjf5xxbhVNdSz5OziCcGeed0sLrFFG50=; b=pbQUAhJhYllCJj6iKoGBp08omwtkp4Jc5IitPHpJsY9Fm1DXfzUs1kfaxbz1Xhq+3H bFfwOZbTav0SY9c8JOlYhMdfqFr6gW073UkT6DrOUocjHSYotfDEpvwzLTuN6tjaXK3N poInACldT7685uCkq0Fx9i6NLGNtUhiuhbLJoF78twPNz5OHchrsr4neUp/bIEXmOW6e eVhGwkIWH55lrrbR0Yazmc4oQthOJGKIyAQJ1US2e0V89pT/90Ugw0dtJQ7fSJnQgQqa /20vP79eJdRhAv5Dsnwh+c+RbS0kyiSds6eJC1WQZBdX6EiLSLPG8qNAehoHTejb+Mvv 5V9Q== X-Gm-Message-State: AOJu0Yw7zvkjjRvkmvZWtf3wGoBvRlIKJ1qguxF3nrf0wgrpoBMd9IFn yAFVQ5IOMQ/kIIriXhrL/0y63lr/97artPsfZNDz+60GQzlsPU3N+yJteHtP8tQ= X-Google-Smtp-Source: AGHT+IG5dDq6mpUDZN/Lh/pnUGBMVqZwzwUuRTDHZ5FeFjsupK6MKUYchtgQsFRiCq4LSbrYnPF9Ow== X-Received: by 2002:a05:6a00:3d09:b0:6ed:435f:ec9b with SMTP id lo9-20020a056a003d0900b006ed435fec9bmr3202140pfb.20.1712596726706; Mon, 08 Apr 2024 10:18:46 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:3e7e:c5ca:dd5b:a5af:8027? ([2804:1b3:a7c0:3e7e:c5ca:dd5b:a5af:8027]) by smtp.gmail.com with ESMTPSA id fx8-20020a056a00820800b006ed4c430acesm1591643pfb.40.2024.04.08.10.18.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Apr 2024 10:18:46 -0700 (PDT) Message-ID: Date: Mon, 8 Apr 2024 14:18:43 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] elf: Check objname before calling fatal_error To: "H.J. Lu" Cc: libc-alpha@sourceware.org References: <20240408160609.1264205-1-hjl.tools@gmail.com> Content-Language: en-US From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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: On 08/04/24 13:58, H.J. Lu wrote: > On Mon, Apr 8, 2024 at 9:47 AM Adhemerval Zanella Netto > wrote: >> >> >> >> On 08/04/24 13:06, H.J. Lu wrote: >>> _dl_signal_error may be called with objname == NULL. _dl_exception_create >>> checks objname == NULL. But fatal_error doesn't. Check objname before >>> calling fatal_error. This fixes BZ #31596. >> >> Do we have a reproducer for this? The one from BZ#31596 does seems to trigger >> it. > > We don't. But it may happen in theory. Why not add the test on fatal_error instead? Because if we are adding possible check for argument where we are not sure that it might trigger, it is clear to me to add where the issue might happen (besides that our policy is to avoid adding fixes without proper reproducers). Also, I think we should close the BZ#31596 as a notabug because the reproducer does not actually trigger an issue and it is misleading that this is a glibc issue. > >>> --- >>> elf/dl-catch.c | 6 +++++- >>> 1 file changed, 5 insertions(+), 1 deletion(-) >>> >>> diff --git a/elf/dl-catch.c b/elf/dl-catch.c >>> index 2109516dba..8ef7a4c706 100644 >>> --- a/elf/dl-catch.c >>> +++ b/elf/dl-catch.c >>> @@ -126,7 +126,11 @@ _dl_signal_error (int errcode, const char *objname, const char *occasion, >>> __longjmp (lcatch->env[0].__jmpbuf, 1); >>> } >>> else >>> - fatal_error (errcode, objname, occasion, errstring); >>> + { >>> + if (objname == NULL) >>> + objname = ""; >>> + fatal_error (errcode, objname, occasion, errstring); >>> + } >>> } >>> rtld_hidden_def (_dl_signal_error) >>>