From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12004 invoked by alias); 6 Apr 2013 15:41:15 -0000 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 Received: (qmail 11995 invoked by uid 89); 6 Apr 2013 15:41:14 -0000 X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,FAKE_REPLY_C,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 06 Apr 2013 15:41:12 +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 r36Ff94p022743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 6 Apr 2013 11:41:09 -0400 Received: from host2.jankratochvil.net (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r36Ff5ED011955 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 6 Apr 2013 11:41:08 -0400 Date: Sun, 07 Apr 2013 05:54:00 -0000 From: Jan Kratochvil To: Aleksandar Ristovski Cc: gdb-patches@sourceware.org Subject: Re: [patch] validate binary before use Message-ID: <20130406154105.GA27972@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <515ECC5C.7040609@qnx.com> <515D7A09.5010305@qnx.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-04/txt/msg00159.txt.bz2 On Thu, 04 Apr 2013 15:03:05 +0200, Aleksandar Ristovski wrote: > The problem is, we could 'remember' build-id that is garbage. [...] On Fri, 05 Apr 2013 15:06:36 +0200, Aleksandar Ristovski wrote: > It is stored in the latest patch, in build-id. OK, true with the new patch. The problem is there is: xfree (so->build_id); in free_so() but it should be in free_so_symbols instead. free_so_symbols is called also from reload_shared_libraries_1 where so_list->abfd can change. Then obviously one should also set so->build_id = NULL there. I was thinking making the BUILD_ID data private so solib-svr4.c but that is currently not possible, lm_info is private for solib-svr4.c but that has lifetime of so_list, not the lifetime of so_list->abfd. Thanks, Jan