- Timestamp:
- Feb 11, 2007, 11:02:54 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r89 r90 13 13 dnl start 14 14 dnl 15 AM_INIT_AUTOMAKE(samhain, 2.3. 2)15 AM_INIT_AUTOMAKE(samhain, 2.3.3) 16 16 AC_CANONICAL_HOST 17 17 … … 1744 1744 # -- NEW -- 1745 1745 kernel_version=`uname -r | sed s,2.6.*,LINUX26,` 1746 kernel_numeric=`uname -r | sed 's%-%.%' | sed 's%_%.%' | awk -F. '{ print $1*100000+$2*1000+$3 }'` 1747 AC_DEFINE_UNQUOTED(SH_KERNEL_NUMERIC, ${kernel_numeric}, [Kernel number]) 1748 1746 1749 if test x"$kernel_version" = xLINUX26 1747 1750 then 1751 1748 1752 sh_modlist_lock=`egrep ['[bd] modlist_lock$'] ${khidemap} | awk '{print $1}'` 1749 1753 if test x"$sh_modlist_lock" = x; then 1750 AC_MSG_ERROR([--enable-khide: symbol modlist_lock not found in ${khidemap}]) 1754 echo "--enable-khide: symbol modlist_lock not found in ${khidemap}" 1755 else 1756 sh_modlist_lock="0x${sh_modlist_lock}" 1757 AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock]) 1751 1758 fi 1752 sh_modlist_lock="0x${sh_modlist_lock}" 1753 AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock]) 1759 1760 sh_modlist_mutex=`egrep ['[bd] module_mutex$'] ${khidemap} | awk '{print $1}'` 1761 if test x"$sh_modlist_mutex" = x; then 1762 echo "--enable-khide: symbol module_mutex not found in ${khidemap}" 1763 else 1764 sh_modlist_mutex="0x${sh_modlist_mutex}" 1765 AC_DEFINE_UNQUOTED(SH_MODLIST_MUTEX, ${sh_modlist_mutex}, [The address of the modules list mutex]) 1766 fi 1754 1767 1755 1768 sh_list_modules=`egrep 'd modules$' ${khidemap} | awk '{print $1}'` -
trunk/src/samhain_hide.c
r51 r90 119 119 /* The configure options (#defines) for the Kernel 120 120 */ 121 #if SH_KERNEL_NUMERIC >= 206019 122 #include <linux/autoconf.h> 123 #else 121 124 #include <linux/config.h> 125 #endif 122 126 123 127 #ifndef LINUX26 … … 164 168 */ 165 169 #include <linux/smp_lock.h> 170 171 #if SH_KERNEL_NUMERIC >= 206019 172 #include <linux/mutex.h> 173 #endif 166 174 167 175 /* Include for fget(). … … 341 349 long dirp_offset; 342 350 351 unsigned long dummy; 352 343 353 lock_kernel(); 344 354 … … 400 410 /* Copy the dirp table to kernel space. 401 411 */ 402 copy_from_user(dirp_new, dirp, status);412 dummy = (unsigned long) copy_from_user(dirp_new, dirp, status); 403 413 404 414 #ifdef FILE_DEBUG … … 498 508 /* Copy our modified dirp table back to user space. 499 509 */ 500 copy_to_user(dirp, dirp_new, status);510 dummy = (unsigned long) copy_to_user(dirp, dirp_new, status); 501 511 #ifdef FILE_DEBUG 502 512 printk("COPY to user\n"); … … 534 544 __s64 dirp_offset; 535 545 546 unsigned long dummy; 547 536 548 lock_kernel(); 537 549 … … 612 624 /* Copy the dirp table to kernel space. 613 625 */ 614 copy_from_user(dirp_new, dirp, status);626 dummy = (unsigned long) copy_from_user(dirp_new, dirp, status); 615 627 616 628 #ifdef FILE_DEBUG … … 716 728 /* Copy our modified dirp table back to user space. 717 729 */ 718 copy_to_user(dirp, dirp_new, status);730 dummy = (unsigned long) copy_to_user(dirp, dirp_new, status); 719 731 kfree (dirp_new); 720 732 unlock_kernel(); … … 768 780 #ifdef LINUX26 769 781 { 782 #if defined(SH_MODLIST_LOCK) 770 783 spinlock_t * modlist_lock = (spinlock_t * ) SH_MODLIST_LOCK; 771 struct module *mod = find_module(SH_INSTALL_NAME"_hide"); 784 #endif 785 #if SH_KERNEL_NUMERIC >= 206019 786 struct mutex * module_mutex = (struct mutex *) SH_MODLIST_MUTEX; 787 #endif 788 789 struct module *mod; 790 791 #if SH_KERNEL_NUMERIC >= 206019 792 mutex_lock(module_mutex); 793 #endif 794 795 mod = find_module(SH_INSTALL_NAME"_hide"); 772 796 if (mod) { 773 797 /* Delete from various lists */ 798 #if defined(SH_MODLIST_LOCK) 774 799 spin_lock_irq(modlist_lock); 800 #endif 775 801 if (removeme == 1) 776 802 { 777 803 list_del(&mod->list); 778 804 } 805 #if defined(SH_MODLIST_LOCK) 779 806 spin_unlock_irq(modlist_lock); 807 #endif 780 808 } 809 #if SH_KERNEL_NUMERIC >= 206019 810 mutex_unlock(module_mutex); 811 #endif 781 812 } 782 813 #endif
Note:
See TracChangeset
for help on using the changeset viewer.