moving from 2.4.xx to 2.6.3...
Hi! I updated my mdk into 10, and installed it with kernel 2.6.3.
And now I'm feeling like an idiot. The problem is, that I have done a module in 2.4.xx and Now i decided to re-write it for 2.6.xx. The module I "rewrote" compiles without any problems, i get the correct .ko - file, but...
I get This when loading it:
"insmod: error inserting 'nodir-driver.ko': -1 Unknown symbol in module"
and doing a dmesg shows the symbol is sys_call_table...
So, it seems to me that either:
a) I have no clue that what headers should I include when i want to modify system calls or
b) I have no idea what is the function to load the sys_call_table.
Could somebody who knows more about the subject look at my source and tell me what is wrong. This source only has a part of the entire program, but it doesn't work either...
****************************************************
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/version.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/syscall.h>
MODULE_DESCRIPTION("Partial trojan blocker");
MODULE_AUTHOR("thautane (thautane@apollo.olympos.athens.fi)");
MODULE_LICENSE("GPL");
extern void* sys_call_table[];
int (*save_mkdir) (const char *path);
int thereisno_mkdir(const char *path){
return 0;}
static int nodir_init_module(void){
save_mkdir=sys_call_table[SYS_mkdir];
sys_call_table[SYS_mkdir]=thereisno_mkdir;
return 0;}
static void nodir_exit_module(void){
sys_call_table[SYS_mkdir]=save_mkdir;}
module_init(nodir_init_module);
module_exit(nodir_exit_module);
**********************************************************
The entire lkm, when loaded, blocks (or should block) all users from reading, writing, chdir'ing, su'ing etc...
|