From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32398 invoked by alias); 26 Nov 2018 10:37:05 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 32387 invoked by uid 89); 26 Nov 2018 10:37:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=relocate X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Nov 2018 10:37:03 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 9A544302BB40 for ; Mon, 26 Nov 2018 11:37:01 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 95423400E83B; Mon, 26 Nov 2018 11:37:01 +0100 (CET) Message-ID: Subject: Re: [PATCH] libdwfl: Fix relocation overlap sanity check. From: Mark Wielaard To: elfutils-devel@sourceware.org Date: Mon, 26 Nov 2018 10:37:00 -0000 In-Reply-To: <1543004401-15437-1-git-send-email-mark@klomp.org> References: <1543004401-15437-1-git-send-email-mark@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-2.el7) Mime-Version: 1.0 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q4/txt/msg00190.txt.bz2 On Fri, 2018-11-23 at 21:20 +0100, Mark Wielaard wrote: > We would not relocate when the relocation section data or the target > section date would overlap with one of the ELF headers. This is only > really necessary if the data comes directly from the mmapped file. > Otherwise there is no real overlap and the relocations can be safely > applied. >=20 > One particular thing we got wrong with the original sanity check was > when the relocation data or target data section was compressed. In > that case it could happen we overestimated the size (because the Shdr > would have been updated to show the uncompressed data size). But > uncompressed data is always malloced and so cannot overlap with the > mmapped Elf header structures. >=20 > When building with CFLAGS=3D"-g -Og" this showed up as a failure in > run-strip-reloc.sh for strip-compressed.o. Where the .debug_loc > section decompressed would "overlap" with the shdrs at the end of > the file and so wouldn't get relocations applied. Pushed to master.