From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18373 invoked by alias); 25 Dec 2012 07:37:28 -0000 Received: (qmail 18312 invoked by uid 22791); 25 Dec 2012 07:37:27 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Dec 2012 07:37:17 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBP7bEkh015119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Dec 2012 02:37:14 -0500 Received: from host2.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBP7b9x9028996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 25 Dec 2012 02:37:12 -0500 Date: Tue, 25 Dec 2012 07:37:00 -0000 From: Jan Kratochvil To: Aleksandar Ristovski Cc: "gdb-patches@sourceware.org" Subject: Re: [patch] validate binary before use Message-ID: <20121225073709.GA11349@host2.jankratochvil.net> References: <50D4C49A.6040502@qnx.com> <50D8B37A.20001@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50D8B37A.20001@qnx.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00810.txt.bz2 On Mon, 24 Dec 2012 20:56:42 +0100, Aleksandar Ristovski wrote: > While writing a testcase I realized the patch as posted did not work > in general cases. Comparing whole elf header and whole pheader is > not an option as they change depending on whether the binary is > stripped and such. The checked fields like vaddr also do not match as the local file is commonly nightly prelinked, unprelinked (after nightly update before prelink has run) or nightly re-prelinked (see prelink(8)). Such prelink-aware verification is already implemented in solib-svr4.c in svr4_exec_displacement. GDB also handles correctly local symbol file in a different prelink state than the debugged target. But still I find this verification less reliable and more complicated than the build-id verification I suggested. Thanks, Jan