Messages in this thread | | | Date | Wed, 4 Sep 2002 19:55:00 +0200 (CEST) | From | <> | Subject | Weird 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/
| |