From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C6FCE382C5FE for ; Tue, 24 May 2022 16:28:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C6FCE382C5FE Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-623-Wh40Ur6KOOe_ggto22SwWA-1; Tue, 24 May 2022 12:28:42 -0400 X-MC-Unique: Wh40Ur6KOOe_ggto22SwWA-1 Received: by mail-wm1-f72.google.com with SMTP id e9-20020a05600c4e4900b00394779649b1so1530011wmq.3 for ; Tue, 24 May 2022 09:28:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=1BPC5KUSwwyDTE97Tq6Ve6td2lbMgoFt2qz0pyC3i8k=; b=YnTDv7sSXXHsX1fyw21hWm4+fGUmRyKAz54v0MHVheCXRXlHBqDkoEOiiyiF/nVTrG E1hAJuy92QQKmkffUen1D7M3YNXEGe8y+6k7eA4AyUF0KxHZcNzJA9F5ExGOPITjLgO2 xuT++nT4vY2xw6cK0TBByHmOLtvfa9Ekbqrr67nx1hWUZkbQmFqwpwYcASDhgUP84Ldo Ym/yCuwc4b48OcDoc7AgjjWZIcebkEYaGw4HFed1jmaJ43fdV3bdTXBLYduTz8qvC9As lPsWmh5+i7heOpBRguB8+DPpVB8bo3c8BsHKSxFKkoBfw9L3U/ZHQbySua58zRT092y1 n/6g== X-Gm-Message-State: AOAM531JRTvEaZvI3Fao9N6Q07i9RBSzNG6rtTQ1+Q+aM/czVQvqTjOO Q9sG2JHEiXlP1YOSoc5MU23Y19mBLkACwY1Xz/8bWYSUeBsAE8dje/xeiMh8DDADb05kp63mCFz sh/cD9vKJMb8pw97aoA== X-Received: by 2002:a05:600c:1986:b0:394:77a3:bfa9 with SMTP id t6-20020a05600c198600b0039477a3bfa9mr4437007wmq.142.1653409719283; Tue, 24 May 2022 09:28:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7cd0SJB0Ka+40CRze4Ju7O4XM+SpwXaD2iJeyxTsC0AXJKHXTHEwXs6mnvL7O4yUjx+RXmw== X-Received: by 2002:a05:600c:1986:b0:394:77a3:bfa9 with SMTP id t6-20020a05600c198600b0039477a3bfa9mr4436994wmq.142.1653409719110; Tue, 24 May 2022 09:28:39 -0700 (PDT) Received: from [192.168.1.6] (adsl-2-solo-173-39.claranet.co.uk. [80.168.173.39]) by smtp.gmail.com with ESMTPSA id az39-20020a05600c602700b003942a244f54sm2682598wmb.45.2022.05.24.09.28.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 May 2022 09:28:38 -0700 (PDT) Message-ID: <60f4baf9-bfc7-dbc3-3ed2-52153e33df07@redhat.com> Date: Tue, 24 May 2022 17:28:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] ld: add --package-metadata To: luca.boccassi@gmail.com, binutils@sourceware.org References: <20220515191846.114257-1-luca.boccassi@gmail.com> From: Nick Clifton In-Reply-To: <20220515191846.114257-1-luca.boccassi@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Tue, 24 May 2022 16:28:48 -0000 Hi Luca, I have just discovered another problem with the patch. Compiling a toolchain with address sanitization enabled and then running the package-note.o test results in: ==2181020==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000007e at pc 0x147930f35e0b bp 0x7fff7bbf1820 sp 0x7fff7bbf0fd0 READ of size 16 at 0x60200000007e thread T0 #0 0x147930f35e0a in __interceptor_memcpy (/lib64/libasan.so.8+0x49e0a) #1 0x8a17df in write_package_metadata /work/sources/binutils/current/ld/ldelf.c:1562 #2 0x98e92d in _bfd_elf_write_object_contents /work/sources/binutils/current/bfd/elf.c:6790 0x60200000007e is located 0 bytes to the right of 14-byte region [0x602000000070,0x60200000007e) allocated by thread T0 here: #0 0x147930fa668f in __interceptor_malloc (/lib64/libasan.so.8+0xba68f) #1 0x1642823 in xmalloc /work/sources/binutils/current/libiberty/xmalloc.c:149 #2 0x1642a13 in xstrdup /work/sources/binutils/current/libiberty/xstrdup.c:34 #3 0x85a988 in gldelf_x86_64_handle_option /work/builds/binutils/current/sanitize-address/ld/eelf_x86_64.c:5361 I think that you might be trying to write out too many bytes.... Cheers Nick