From: "Jan Beulich" Subject: Re: [PATCH] linux: prevent non-Xen modules fromloading in Xen kernel Date: Fri, 18 Jan 2008 15:48:17 +0000 Message-ID: <4790D851.76E4.0078.0@novell.com> References: <4790CB11.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Zachary Amsden , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org It's intended to disallow cross-version loading of modules (i.e. a module compiled against a kernel built with a different [lower or higher] Xen interface) - allowing such can be as dangerous as loading a module that was compiled against native I believe. Jan >>> Keir Fraser 18.01.08 16:35 >>> Does the XEN_INTERFACE_VERSION add anything? It has not much to do with = the module<->Linux-core interface. Seems a pretty random thing to stuff into = the module magic version string. -- Keir On 18/1/08 14:51, "Jan Beulich" wrote: > .. and vice versa. >=20 > Inspired by Zach Amsden's functionally similar VMI patch. >=20 > As usual, written and tested on 2.6.24-rc7 and made apply to the 2.6.18 > tree without further testing. >=20 > Signed-off-by: Jan Beulich >=20 > Index: head-2008-01-08/drivers/xen/Kconfig > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- head-2008-01-08.orig/drivers/xen/Kconfig 2008-01-08 12:26:03.00000000= 0 > +0100 > +++ head-2008-01-08/drivers/xen/Kconfig 2008-01-08 14:56:58.000000000 = +0100 > @@ -13,7 +13,7 @@ config XEN > if XEN > config XEN_INTERFACE_VERSION > hex > - default 0x00030207 > + default 0x30207 > =20 > menu "XEN" > =20 > Index: head-2008-01-08/include/linux/vermagic.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- head-2008-01-08.orig/include/linux/vermagic.h 2006-11-29 > 22:57:37.000000000 +0100 > +++ head-2008-01-08/include/linux/vermagic.h 2008-01-08 15:01:52.00000000= 0 > +0100 > @@ -17,6 +17,11 @@ > #else > #define MODULE_VERMAGIC_MODULE_UNLOAD "" > #endif > +#ifdef CONFIG_XEN > +#define MODULE_VERMAGIC_XEN "Xen:" __stringify(CONFIG_XEN_INTERFACE_VERS= ION) > " " > +#else > +#define MODULE_VERMAGIC_XEN > +#endif > #ifndef MODULE_ARCH_VERMAGIC > #define MODULE_ARCH_VERMAGIC "" > #endif > @@ -24,5 +29,6 @@ > #define VERMAGIC_STRING \ > UTS_RELEASE " " \ > MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ > - MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC \ > + MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_XEN \ > + MODULE_ARCH_VERMAGIC \ > "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) >=20 >=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com=20 > http://lists.xensource.com/xen-devel=20