From patchwork Wed Jan 4 13:26:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 38922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5142068wrt; Wed, 4 Jan 2023 05:26:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXvp2WGRtIfZkQKClCJBWTn0V2q8u4GbRTFHloR4VmssInN/o7JUyzz8btXCTGmxi9zBJ/WK X-Received: by 2002:a17:906:1c59:b0:7e5:856d:6365 with SMTP id l25-20020a1709061c5900b007e5856d6365mr39792178ejg.50.1672838805270; Wed, 04 Jan 2023 05:26:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672838805; cv=none; d=google.com; s=arc-20160816; b=xy0UPLHD1UMAl/CYWGYoSGmp6Qs2GnSa30xvQWA6lW4XCMkQQsuTJDGZilHGJEp/cD S0e6gGZkQnPho3GvDDN60kLqai7UO3B6+u3ygltrNb572isSu0u3SIqRCaizaZxICfsY OiMhHbe41ktcMR8qsGRyt/1jjd0JmDz4jiQHXi69i47/AI6jCUq1/0YMDwObkGjC73uQ nel3WHmGXS129eWtGrAhVYR55BrP7J6T5hVgld3kbe1WGClE+gAGM1jFdlLEqZuhz3Jp EvbTNHGCcdBQYGBOQqcBbxQ9SGmVqqWTWa1xF5/5zA5sA/E2eDOl4sRLhoMYilDkvgKR 0tyA== 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=lpvYlE1Wu3sK9+5c0ZNefM6ZR/sNzQkI/gDZ5kRrKas=; b=b690oyYsWeXjZ74ylFspRm1d5OWDh/0SK2hKHK/MBVm2bF/8T8257XE8EWIWucbKDo MdYZRWO/3q59UhrZX8F4FY363qPAf0w5z0B6gI7QzvlrQ65zTdg9RSiL/Yah0MyigDdA pc/TWi5JDCPe7jr4bI1UuG3v4oNgN3AJR+B+LlrA2Twy2eRyuCIs/ANcHlv4XzEO/vh7 s+6v90rW4hKa9hj6joh6qIjZj7JLgkyegeqt2m5IvDZsqpyB/sNZQjVjaZ94yPX6qzr6 +kG7UXwqgCXseg2+NYSt0g7TT7Humo8jMFROmsJOUe/1VHajN4lX1/Hsy5lFX+2CZiyE nR6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="YIJvQ/va"; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b14-20020a056402084e00b0046187ab5c1bsi34565887edz.512.2023.01.04.05.26.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 05:26:45 -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="YIJvQ/va"; 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 2C5B83858C60 for ; Wed, 4 Jan 2023 13:26:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C5B83858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672838803; bh=lpvYlE1Wu3sK9+5c0ZNefM6ZR/sNzQkI/gDZ5kRrKas=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=YIJvQ/valQx87I7z7Kx2HrFLB4KyfhhTHNZ9BfYxz0gRRjsB5YA2ElqXQKf0mgHTW m+DZOXsAgBv7kvvJd1FCwxivd37IXDMnm/Rfj6Ky92fDKk+h9shAhzwMw8ENpFlz/8 GLoWDgcEic87UfFXqc/1yANuEeZw3YGE0/eKSRdw= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 7F0E93858C2D for ; Wed, 4 Jan 2023 13:26:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F0E93858C2D Received: by mail-pj1-x102d.google.com with SMTP id o8-20020a17090a9f8800b00223de0364beso38918454pjp.4 for ; Wed, 04 Jan 2023 05:26:31 -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=lpvYlE1Wu3sK9+5c0ZNefM6ZR/sNzQkI/gDZ5kRrKas=; b=w/km5lipLc4q3Uc6eJNS2BHn/amjMi8Pfq1nAIzw+EaDJGG1zlHjALYQamETVSRoHo DmkEsq6mWBEDxW3VKWOujf5yBiMrYhVN/7LmKhlzdT5JIrYagVyFD3Zj6jSR6GvK26Ml nf4PUGYVx7ZLWCR414XKZ4b4xKkPOzfiL2xpvfKOpdPir/h1SB5UC9d36kMBSVlg5gE+ DnRYEGESGhiBlvUjlUgKUUSr5doC0UzN2fazWlnEPuiggBT1f3F2wjhzriipmqWjNYHn R2UToyORgGFXb3DQ6/4gg8s0IOrFH2wL2ZTSuxCkUEVdNQBxuu6POG90Wo66x7JiJU5j OCmw== X-Gm-Message-State: AFqh2kqAVEp7aeJAKxI7oadmYWaak6Aj5RR+/ipDG7imoOS5hwvGhx0W cvdrVzOa03d+0+zEwvoNTzqx9cJHnAQ= X-Received: by 2002:a05:6a20:3942:b0:a5:7700:2a4a with SMTP id r2-20020a056a20394200b000a577002a4amr79767729pzg.51.1672838790316; Wed, 04 Jan 2023 05:26:30 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:934:e2e8:56f6:280a]) by smtp.gmail.com with ESMTPSA id i68-20020a626d47000000b0056b4c5dde61sm23034318pfc.98.2023.01.04.05.26.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 05:26:29 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id BB5EB1142D30; Wed, 4 Jan 2023 23:56:27 +1030 (ACDT) Date: Wed, 4 Jan 2023 23:56:27 +1030 To: binutils@sourceware.org Subject: fuzzed file timeout Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.2 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?1754098623127886552?= X-GMAIL-MSGID: =?utf-8?q?1754098623127886552?= objcopy of archive, element containing an object with a fuzzed section size far exceeding the element size. copy_section detects this, but the temp file is laid out for the large section. It can take a long time to write terabytes of sparse file, a waste of time when it will be deleted. * objcopy.c (copy_archive): Don't write element contents after bad status result from copy_object. diff --git a/binutils/objcopy.c b/binutils/objcopy.c index a6182b48b6c..4d888906e67 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -3686,7 +3686,8 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, if (!ok_object) del = !copy_unknown_object (this_element, output_bfd); - if (!(ok_object && !del ? bfd_close : bfd_close_all_done) (output_bfd)) + if (!(ok_object && !del && !status + ? bfd_close : bfd_close_all_done) (output_bfd)) { bfd_nonfatal_message (output_name, NULL, NULL, NULL); /* Error in new object file. Don't change archive. */