From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by sourceware.org (Postfix) with ESMTPS id 00FAB3858D28 for ; Tue, 2 Apr 2024 15:01:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00FAB3858D28 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 00FAB3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712070064; cv=none; b=Y3DETLlL1MpcURZrFLYPQhc3Ye0kqP9z7RdBMHdls2SBBcmvhb1qnnnoF/TSm+gonzNHj5ALsm0FmrgPP3NC6RQLQT+++7VVuY3a6cbDfT1W0aapkNJ4EXO9HcNl1fo292UZyHFMBNm94X8WGNsL7xoU8+zf06aPJ+POwZDo7jU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712070064; c=relaxed/simple; bh=aHK9f3pEEm6Ev48n1UNXvddrRuNvF3rKMBXrjKBePNs=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=GVbKwluSkaZfmgkhnUinc1krJdhPK6WsnspIastvT1FrMlGqcLGxIVDOpuyLYcVJCTi6iETWwnmDfQRQyBndKhfr4kC0RvOnqMBXqkzOsA6kepVYpuN6+AP5waNr7GSEA3akAKQn17ZY6zLS3dL3VlkZdal+kvNJoxBd1TyoyKQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-dc6d8bd612dso5299140276.1 for ; Tue, 02 Apr 2024 08:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712070060; x=1712674860; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qL0m5aNZ/km8fcReSU7SHKnHK91LTC21APVX12jAGqo=; b=maNWwv1u4SuVU8UHW3JMOhKXv/2lRBGXa0DFxSFWwMLc8FGZOjdtFPy4NQG+qr/AiP NPMXX9YacITN+UAS+o1+IBLnSxKmjJ/+L4nwKO/ZMx4HJZgeXTlL4t4PWygjGu/aqk+U Tdaj14HlHPI5MF8TUZ+E78dyB4hAMLiqqtyoqj7D7Yn+LAxcifbXYCe0/CycMZLmqFH5 9DNeEV3vlb8/LTt9gYla+slOrWuUvjxHVYazAqMHOrUTQdKigAhxwd0JbywO8+y1asgO Le7RCkVz1IC/r1D8V6zj1lnRp6J2Yx1b9PEy1K10M6SVOWLXNjaXG0a6C3iVuUYflTI3 A6zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712070060; x=1712674860; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qL0m5aNZ/km8fcReSU7SHKnHK91LTC21APVX12jAGqo=; b=vD0SXznLsycEiwJkHSE2Rwi+YZmHGXnGfLLu+D1eb/MeHN4T2xGc/LXQBElAi0Ujgu tCDhWer6lgIx4/07bQq66fhP6Wv/J9xHg9ozaDMVtT3HFzo9+gCuCRcbW9ZwKeBIL6OR 0GdheASRxgx4PwBBS3Nz5baT3MMeLKAD5ufrjN4HrazUTv9neTgQVcyin6mLgWlVpc0N zzUxb7qboh0ZAUmctelmAvSGcd2kKGOL6sW+arf04deFa98pTfo26mad8moKzp7XdXAJ aydWRyhHf5ULNbkW5QLlflydvGaml8k/EIqD1h7UXCDIvDEWfQHqOevlbYfovhO1F3vU drVA== X-Forwarded-Encrypted: i=1; AJvYcCUE9y1/T7hCHqOo6JnLF3UxQ6LJP1ZG2hUeu9pkpt05HZjAveLjZbwkGTaJ6qVr/5GBIhVoosLsUNqxP5qmoCFUt6xTWMOTWxNu X-Gm-Message-State: AOJu0Yy/BJSR8Y+pQROXVVcpJqNG22xNOiAy7u4wl0W0Yc3ZAn1nW7GF 2DoGiJdYZoiR/FzEnT9XpZ0VjPpmrKjPEYCZFyo6gUamcqnYiB3OhBSvZ6G8fo1RTf78WTsjEyi GppK4LkdXAshlZJTI4WHjExbcNQs= X-Google-Smtp-Source: AGHT+IFvtnFBlbQV0G3oSj5tsyeOQyetYmy0ccyZZJU2k/3tKf9Qndk9g5FSWDYaL2Fvvgiom5jiD5nulHWoy6POVoI= X-Received: by 2002:a25:46d5:0:b0:dcc:7c0f:2222 with SMTP id t204-20020a2546d5000000b00dcc7c0f2222mr9987127yba.22.1712070059956; Tue, 02 Apr 2024 08:00:59 -0700 (PDT) MIME-Version: 1.0 References: <1711806052-117857-1-git-send-email-xiaojiangfeng@huawei.com> <1711939509-1411-1-git-send-email-xiaojiangfeng@huawei.com> <3f6a6290-9136-4a72-a24b-7c6bb7965569@linaro.org> <0d0aaf71-4f20-0bc1-9ac7-f31f1b426398@huawei.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 2 Apr 2024 08:00:23 -0700 Message-ID: Subject: Re: [PATCH] elf: sanitize objname in _dl_signal_error To: Jiangfeng Xiao Cc: Adhemerval Zanella Netto , libc-alpha@sourceware.org, schwab@linux-m68k.org, nixiaoming@huawei.com, douzhaolei@huawei.com, wangbing6@huawei.com, wangfangpeng1@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3013.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 Tue, Apr 2, 2024 at 7:54=E2=80=AFAM Jiangfeng Xiao wrote: > > > > On 2024/4/2 22:42, H.J. Lu wrote: > > On Tue, Apr 2, 2024 at 7:38=E2=80=AFAM Jiangfeng Xiao wrote: > >> > >> > >> > >> On 2024/4/1 21:50, Adhemerval Zanella Netto wrote: > >> > >> > >>> How did you trigger this issue, either from user provided ABI (dlfcn.= h) > >>> or some some internal usage (if any)? If this is a user-visible issue > >>> it will require a bug report and a reproducer. > >>> > >> > >> Thanks for your reply. > >> > >> > >> The following are my reproduction cases: > >> > >> ``` > >> #include > >> > >> int main(void) > >> { > >> (void)dlopen("not_exist.so", -1); > >> > >> return 0; > >> } > >> > >> ``` > >> > >> However, this case cannot be reproduced in a common environment. > >> > >> I reproduced this issue in the arm32 environment. > >> Glibc in the environment is compiled using the Clang compiler. > > > > Is it a Clang bug? > > > > Maybe. However, the glibc code may reference null pointers, > which should be fixed. Not if a null pointer should never happen. > >> The glibc version is 2.34. (The patches that supports Clang > >> compilation has been applied to this version) > >> > >> I have not figured out why the lcatch variable > >> in the _dl_signal_error function is null. > >> As a result, the exception branch > >> fatal_error(0, NULL, NULL, NULL, "invalid mode parameter") > >> is executed. > >> Maybe my Clang compiler's compilation parameters > >> are not configured properly. > >> > >> I can then be sure that if glibc is compiled by the GCC compiler, > >> it should not trigger this issue. > >> > >> I don't think the glibc mainline branch will trigger this problem > >> because glibc has not officially promised to support Clang. > >> So I think I'd rather not submit a bug report first. > > > > > > --=20 H.J.