From 970abe11fe7f076a9bfbd8be6dbdf3aa26f9b5b5 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 10 Dec 2003 23:26:10 +0000 Subject: [PATCH] - kernel_text_address patch against chaos-2.4.18 series --- .../patches/kernel_text_address-2.4.18-chaos.patch | 40 ++++++++++++++++++++++ lustre/kernel_patches/series/chaos-2.4.18 | 1 + 2 files changed, 41 insertions(+) create mode 100644 lustre/kernel_patches/patches/kernel_text_address-2.4.18-chaos.patch diff --git a/lustre/kernel_patches/patches/kernel_text_address-2.4.18-chaos.patch b/lustre/kernel_patches/patches/kernel_text_address-2.4.18-chaos.patch new file mode 100644 index 0000000..bcfc372 --- /dev/null +++ b/lustre/kernel_patches/patches/kernel_text_address-2.4.18-chaos.patch @@ -0,0 +1,40 @@ +Index: linux-2.4.18-chaos/arch/i386/kernel/traps.c +=================================================================== +--- linux-2.4.18-chaos.orig/arch/i386/kernel/traps.c 2003-07-28 17:51:13.000000000 +0400 ++++ linux-2.4.18-chaos/arch/i386/kernel/traps.c 2003-12-11 02:10:33.000000000 +0300 +@@ -1153,3 +1153,35 @@ + EXPORT_SYMBOL_GPL(nmi_watchdog); + #endif + ++#ifdef CONFIG_MODULES ++extern struct module *module_list; ++extern struct module kernel_module; ++#endif ++ ++int is_kernel_text_address(unsigned long addr) ++{ ++ int retval = 0; ++#ifdef CONFIG_MODULES ++ struct module *mod; ++#endif ++ if (addr >= (unsigned long) &_stext && ++ addr <= (unsigned long) &_etext); ++ return 1; ++ ++#ifdef CONFIG_MODULES ++ for (mod = module_list; mod != &kernel_module; mod = mod->next) { ++ /* mod_bound tests for addr being inside the vmalloc'ed ++ * module area. Of course it'd be better to test only ++ * for the .text subset... */ ++ if (mod_bound(addr, 0, mod)) { ++ retval = 1; ++ break; ++ } ++ } ++#endif ++ ++ return retval; ++} ++ ++EXPORT_SYMBOL(lookup_symbol); ++EXPORT_SYMBOL_GPL(is_kernel_text_address); diff --git a/lustre/kernel_patches/series/chaos-2.4.18 b/lustre/kernel_patches/series/chaos-2.4.18 index e517d06..c9ded5c 100644 --- a/lustre/kernel_patches/series/chaos-2.4.18 +++ b/lustre/kernel_patches/series/chaos-2.4.18 @@ -33,3 +33,4 @@ listman-2.4.18.patch ext3-trusted_ea-2.4.18.patch gfp_memalloc-2.4.18-chaos.patch ext3-xattr-ptr-arith-fix.patch +kernel_text_address-2.4.18-chaos.patch -- 1.8.3.1