From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJpQe-0002D8-90 for qemu-devel@nongnu.org; Wed, 11 Sep 2013 14:46:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJpQV-0008VW-R3 for qemu-devel@nongnu.org; Wed, 11 Sep 2013 14:46:16 -0400 Received: from mail-ie0-x22a.google.com ([2607:f8b0:4001:c03::22a]:41071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJpQV-0008V6-Gn for qemu-devel@nongnu.org; Wed, 11 Sep 2013 14:46:07 -0400 Received: by mail-ie0-f170.google.com with SMTP id 17so11489713iea.29 for ; Wed, 11 Sep 2013 11:46:06 -0700 (PDT) Sender: Richard Henderson Message-ID: <5230BA69.1000202@twiddle.net> Date: Wed, 11 Sep 2013 11:46:01 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1378906448-15834-1-git-send-email-famz@redhat.com> <1378906448-15834-5-git-send-email-famz@redhat.com> <20130911154841.GD2293@redhat.com> In-Reply-To: <20130911154841.GD2293@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: peter.maydell@linaro.org, Fam Zheng , mjt@tls.msk.ru, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, vilanova@ac.upc.edu 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. 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~