LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-05-2004, 03:12 AM   #1
Tih8710
Member
 
Registered: Jan 2003
Location: Finland
Distribution: ElementaryOS Freya as main, every other ubuntu-based as testing
Posts: 124

Rep: Reputation: 15
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...
 
Old 05-06-2004, 09:59 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hi,

I think that your real problem is that sys_call_table was an exported symbol in kernel 2.4 whereas it's not in kernel 2.6. So either you hack your kernel to export this symbol... But there's probably a reason if sys_call_table is not anymore an esport symbol in 2.6 release. Or you find the way they use to replace this feature.

Oliv'
 
Old 06-21-2004, 06:55 AM   #3
Tih8710
Member
 
Registered: Jan 2003
Location: Finland
Distribution: ElementaryOS Freya as main, every other ubuntu-based as testing
Posts: 124

Original Poster
Rep: Reputation: 15
Hmm, sounds like I really DO have a problem...
Well, If anyone could point me into the right direction, I'd appriciate it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with moving to another hd jclu Linux - Hardware 0 11-30-2005 11:40 AM
moving along so far.... Tbagz Linux - Newbie 3 10-31-2005 05:20 AM
moving from one hd to another katy_c4c Linux - Newbie 3 10-22-2004 03:56 AM
copying/moving stalls when moving a lot of data to a usb stick =X¥®µ§= Linux - Hardware 10 07-30-2004 05:29 AM
Moving up MasterC Linux - General 10 06-06-2002 05:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration