lkml.org 
[lkml]   [2002]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectWeird module problem.


Heya,

I`ve got some weird problem in one of my linux machines. I`m writing
simple module, that should catch some syscall which isn`t too hard.
My linux kernel version is 2.2.21 without any patches. The main problem is
that whenever i call the right syscall from user, my uid is always = 0.
The current is not NULL, but all current variables are.

the code is easy, and looks like this(for example of course)


extern void *sys_call_table[];

uid_t (*o_getuid) (void)

uid_t n_getuid(void)
{
printk("User uid: %d\n", current->uid);
return o_getuid();
}

int
init_module()
{
unsigned long flags;
save_flags(flags);
cli();
o_getuid = sys_call_table[__NR_getuid];
sys_call_table[__NR_getuid] = n_getuid;
restore_flags(flags);
return 0;
}

void
cleanup_module()
{
unsigned long flags;
save_flags(flags);
cli();
sys_call_table[__NR_getuid] = o_getuid;
restore_flags(flags);
}

Basicly the above example is trivial, and should work. But it doesn`t on
my linux box. The machine is smp. The module works on every other linux
that i`ve tested(all were single processors).

Any hints about this?

Best Regards,

airot...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.026 / U:4.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site