From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x434.google.com with SMTP id y203so12551815pfb.4 for ; Mon, 21 Nov 2022 13:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=gZCAZ549za8MK71KxFes3Z4cN+YE0tJqnMCwKJf28uc=; b=Z8kE6FDeSwCTc1l/jaRc6u2/nEs6TVJPDDdNK1dWh1d55k+f3u9kfCjGCPm/2xuTz6 HtXpBiksdU2dHKGHz62VqjUTHGQONc4zka6gy7ulj79pRhZGQQRXdxbOpReU977KsLfu 4Ubs3cMweLG7o9KiwiwW1/yOzIj/P/FX9K6CCfSfAc9Uc8tP5seR/qeka6NZmKed1HzX c+dvEOrcep+octMR6sCh3l8HnVH5thj+Uo25PWRa8EHjUrbXlT3Cwke+4j3VP8MbFWbd 6l1SIifhQDlkEvz8tOObQzgIdeC7L2jcXo+/XqQjJNSjhXo9nRQeIdXSh9oTp73KVUOy OhLQ== 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-Google-Smtp-Source: AA0mqf6qaZV3zf7YTYzdicDgOjX1sadIW8fva/YMHC4JIcobztHSbQe5FtTHFBIuhgBwm0WEoexhyg== 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 From: Alan Modra To: binutils@sourceware.org Subject: PR29807, SIGSEGV when linking fuzzed PE object Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 List-Id: 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 -- Alan Modra Australia Development Lab, IBM