From patchwork Mon Nov 21 21:48:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 24026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1851508wrr; Mon, 21 Nov 2022 13:48:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf51+qNT07FDhoquQLUBd0m3TC+YlvYMEUlGTQffvdzZwIXIvBacrHxOxGMF+vUZX7D0xJLb X-Received: by 2002:aa7:cb96:0:b0:461:bacd:c85d with SMTP id r22-20020aa7cb96000000b00461bacdc85dmr17595282edt.278.1669067324769; Mon, 21 Nov 2022 13:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669067324; cv=none; d=google.com; s=arc-20160816; b=zc24aJ86r9IIOJjsMKIzmLMFWv/D/PUAg9EgKEyZ57H+0jyV/6Dym8c7jgGs1utCsN +myLqEgogszXRGgsx14sec0sdrCjl0UE72jkjCK7l4IrNq+e4ofvtBHMdGloMgRjOgPr JBpPEUELBVMPbvNTcDTgOT2B8Itwo7/BUNfr7XuJXE4DthtuckYIFw4+ag2a17zoyhon VNUdRpaDbDKFmoFqecRp/XXtTAh+lXWexMv4q5mIQNxNIKhc7cBkI/KkCttv97U+Siyc Mk5M+EaJJOHdzuubq4UfHIyv5zwswZGZBWVDmCs8jPSRP4pgKUD09cShDDwZvO42nU4k BMaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=gZCAZ549za8MK71KxFes3Z4cN+YE0tJqnMCwKJf28uc=; b=eK9DpmGSXzvaiBPZXTCYJw2T0xlKQWIE5QXcajJkiRFzMdQsaQU1EA3Vmo49qw65wz zHTBEWC9MGa9sYRcQqLfdUnt8F5z7pdXAKezXGET1tvBqtAKshaPY9+7uqFJsdVGEIut 66XlEAcrRGB+JMHCsUZfil2g2SWGENqwUnzJSgJANnbmYW1jKl2krsYrHqBr8g1VNs2E d+DwbIhpXzzIeSILk9SfX5+VQXhXvcOJyjwdDDS1Pa/1jqSWiSxQCx3DMSaW2JtH6fnz Kh1SkW+CH3eV1LOSbR9qdOEtJGcAin+o01szzJc12tEdqI+PVIlylMy80tijRCYqRYaU N5/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=XTypiJCe; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id g35-20020a056402322300b0045ccd2c9944si10119119eda.233.2022.11.21.13.48.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 13:48:44 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=XTypiJCe; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C370F384F011 for ; Mon, 21 Nov 2022 21:48:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C370F384F011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669067323; bh=gZCAZ549za8MK71KxFes3Z4cN+YE0tJqnMCwKJf28uc=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XTypiJCeVofq+pwUpxFKKIE8joVywL6i9ZswyvCy8Sdcf4M3Z+kXAYecc8b7lpkPF FVB4UN3B9jizqqvcECB3gO1/7NYmIox4HK/8HTfbHhDvUoGJytHPfePaiRPPhnCN3b sszQZ9oXiFyX1u6bKkRiZoYN5ukFy7jwRIsSbknc= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id E44C53858423 for ; Mon, 21 Nov 2022 21:48:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E44C53858423 Received: by mail-pf1-x434.google.com with SMTP id y203so12551815pfb.4 for ; Mon, 21 Nov 2022 13:48:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gZCAZ549za8MK71KxFes3Z4cN+YE0tJqnMCwKJf28uc=; b=nFnvKQyCoE0TeV0ZMI7cOH2D64m7DZYGBNDQsCV3US+mP4LgK5+8csnN+9MAlgthPW vUoiKM1jnl4sgXxyEmNEXcNMCmo2ASPea4zX24oe4ld6AdZJcrqPAyDW8tOA+wCMP6uo cQxG+deh2vNF5kJyKsTjAtK5SZ0OjcMDSihAOkTpFZC+BfnSXVWbVh5SOw5az8iQDz3t PszFPdFLpjpUncTNeInDlZ676f28GStEtrePhovW/0sSPpIvr9l/1OFZt4vE6QPBc6lK yKrt34EIvdpmZBzE4cIkg2zYGdQS71FDyDAhePiSmOMBb8ir3I5phDo8wfaTqmKDupZp fwrQ== X-Gm-Message-State: ANoB5pk9dQg5ur8aNn/AB8n+hzN9YG+NgIH2qJR0plcxO4p41PD/UR2z OhPNiBcLokPbj/MAXQ/8W1cDVAv1q0U= X-Received: by 2002:a05:6a00:4210:b0:56c:b8c2:ee89 with SMTP id cd16-20020a056a00421000b0056cb8c2ee89mr1350236pfb.21.1669067314436; Mon, 21 Nov 2022 13:48:34 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:f3ec:1e48:1db6:40bf]) by smtp.gmail.com with ESMTPSA id j4-20020a170903028400b001743ba85d39sm10218084plr.110.2022.11.21.13.48.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 13:48:33 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 71C631142D3B; Tue, 22 Nov 2022 08:18:31 +1030 (ACDT) Date: Tue, 22 Nov 2022 08:18:31 +1030 To: binutils@sourceware.org Subject: PR29807, SIGSEGV when linking fuzzed PE object Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.5 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, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750143938815750623?= X-GMAIL-MSGID: =?utf-8?q?1750143938815750623?= PR 29807 * cofflink.c (_bfd_coff_generic_relocate_section): Skip relocs against symbols with a NULL section. diff --git a/bfd/cofflink.c b/bfd/cofflink.c index a5b936fd7c1..cd117a445c6 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -2961,8 +2961,10 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd, sec = sections[symndx]; /* PR 19623: Relocations against symbols in - the absolute sections should ignored. */ - if (bfd_is_abs_section (sec)) + the absolute sections should ignored. + PR 29807: Also ignore relocs against file symbols or + other such nonsense in fuzzed objects. */ + if (sec == NULL || bfd_is_abs_section (sec)) continue; val = (sec->output_section->vma