From 4d7406d4d7d2d2a11bfc29b44145600d002bac0a Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Mon, 7 Apr 2008 04:49:00 +0000 Subject: [PATCH] DEVEL15-linux-no-syscall-probe-with-no-init-mm-20080406 LICENSE IPL10 FIXES 88000 no better idea for this, got to do something... push this for now (cherry picked from commit c7ee4828e0d7c631fcd827d1a4c9af8bebb2fc2d) --- acinclude.m4 | 5 ++++- src/afs/LINUX/osi_probe.c | 7 +++++++ src/cf/linux-test4.m4 | 7 +++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 4776c3d35..adc2b5ef1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -692,6 +692,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_SYSCTL_TABLE_CHECKING LINUX_HAVE_IGET LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH + LINUX_EXPORTS_INIT_MM LINUX_EXPORTS_SYS_CHDIR LINUX_EXPORTS_SYS_CLOSE LINUX_EXPORTS_SYS_OPEN @@ -704,7 +705,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) ac_cv_linux_exports_ia32_sys_call_table=yes fi else - LINUX_EXPORTS_INIT_MM LINUX_EXPORTS_KALLSYMS_ADDRESS LINUX_EXPORTS_KALLSYMS_SYMBOL LINUX_EXPORTS_SYS_CALL_TABLE @@ -927,6 +927,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_struct_nameidata_has_path" = "xyes" ; then AC_DEFINE(STRUCT_NAMEIDATA_HAS_PATH, 1, [define if your struct nameidata has path]) fi + if test "x$ac_cv_linux_exports_init_mm" = "xyes" ; then + AC_DEFINE(EXPORTED_INIT_MM, 1, [define if your kernel exports init_mm]) + fi if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if tasklist_lock exported]) fi diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c index 7c5400e93..e1a0aaa1f 100644 --- a/src/afs/LINUX/osi_probe.c +++ b/src/afs/LINUX/osi_probe.c @@ -45,6 +45,7 @@ /* Code to find the Linux syscall table */ +#if defined(EXPORTED_INIT_MM) #ifdef OSI_PROBE_STANDALONE #define OSI_PROBE_DEBUG #endif @@ -1481,3 +1482,9 @@ module_init(osi_probe_init); module_exit(osi_probe_exit); #endif #endif +#else +void *osi_find_syscall_table(int which) +{ + return 0; +} +#endif /* EXPORTED_INIT_MM */ diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 995c5da3a..09e713dde 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -81,10 +81,9 @@ AC_DEFUN([LINUX_EXPORTS_INIT_MM], [ AC_MSG_CHECKING([for exported init_mm]) AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [ AC_TRY_KBUILD( -[#include ], -[#ifndef __ver_init_mm -#error init_mm not exported -#endif], +[extern struct mm_struct init_mm;], +[void *address = &init_mm; +printk("%p\n", address);], ac_cv_linux_exports_init_mm=yes, ac_cv_linux_exports_init_mm=no)]) AC_MSG_RESULT($ac_cv_linux_exports_init_mm)]) -- 2.39.5