Received: from eggs.gnu.org ([2001:4830:134:3::10]:35008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJxB8-0004xp-Gn for qemu-devel@nongnu.org; Wed, 11 Sep 2013 23:02:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJxB2-0005mV-53 for qemu-devel@nongnu.org; Wed, 11 Sep 2013 23:02:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJxB1-0005mR-Sx for qemu-devel@nongnu.org; Wed, 11 Sep 2013 23:02:40 -0400 Date: Thu, 12 Sep 2013 11:02:32 +0800 From: Fam Zheng Message-ID: <20130912030232.GK9134@T430s.nay.redhat.com> References: <1378906448-15834-1-git-send-email-famz@redhat.com> <1378906448-15834-5-git-send-email-famz@redhat.com> <20130911154841.GD2293@redhat.com> <5230BA69.1000202@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5230BA69.1000202@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: peter.maydell@linaro.org, mjt@tls.msk.ru, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, vilanova@ac.upc.edu On Wed, 09/11 11:46, Richard Henderson wrote: > On 09/11/2013 08:48 AM, Daniel P. Berrange wrote: > > We know the precise list of valid modules when building QEMU, > > so IMHO, this should just explicitly load each known module > > name, and *not* readdir. Also it should do something along the > > lines suggested their of poisoning exported symbols with a > > build hash to guarantee the modules loaded match the original > > binary and that the symbols change on every rebuild. > > We need not mangle the symbols, which could be complicated to > actually implement, and irritating to work around within gdb. > Agree with this, some id or hash check should be enough. > We could instead just add the build-id as a variable within > the module. Read and compare the build-id after loading the > module; unload and reject on mismatch. > > > r~