> Look at this:
> [1]int init_module(void)
> [2]{
> [3] orig_fsync=sys_call_table[SYS_fsync];
> [4] sys_call_table[SYS_fsync]=hacked_fsync;
> [5] return 0;
> [6]}
> Unless there is a LOCK on sys_call_table[SYS_fsync] another CPU could
> replace the pointer between lines 3 and 4. At that point line 4 would
> destroy the existing entry.. or destroy it when the original is restored,
> and would NOT be restoring the one insterted.
Yes, that's actually part of what I meant with my first quoted
paragraph above. Did not come out that way, sorry.
I can see one problem on unload, if the memory used by the module is
freed while another CPU is executing the module code, but it should be
easy enough to protect against with a lock.
Assuming that loads are unloads are manually serialized in the
correct order are there any other problems?
-- - Terje malmedal@usit.uio.no - 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/