|
From: | Michael Tokarev |
Subject: | Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function |
Date: | Thu, 12 Sep 2013 09:36:43 +0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130827 Icedove/17.0.8 |
12.09.2013 07:02, Fam Zheng wrote.
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.
A solution which I proposed at the very beginning -- to export a "hashed" init function from modules, and call it from the main executable. Like, instead of, say, qemu_module_init(), call qemu_module_init_0xdeadbeaf(), where 0xdeadbeaf is a hash of some build-dependent value. This should be enough to keep it going. Ofcourse, if a module lacks this function, it should not be loaded. Thanks, /mjt
[Prev in Thread] | Current Thread | [Next in Thread] |