Re: access_ok inside kernelspace

Ralf Baechle (ralf@uni-koblenz.de)
Wed, 20 Oct 1999 14:14:25 +0200


On Tue, Oct 19, 1999 at 03:11:16PM +0100, Alan Cox wrote:

> > sys_close() and sys_tz() are the only ones exported on x86, I think. But
> > sys_call_table[] is also exported so presumably it is the best to make
> > a system call from a module via sys_call_table[__NR_XXX] pointer.
>
> Who says sys_call_table[__NR_XXX] is a pointer to a function or even exists
> in that form on non x86 machines. Think about the portability side

bash$ grep sys_call_table kernel/*.c
kernel/ksyms.c:extern void *sys_call_table;
kernel/ksyms.c:EXPORT_SYMBOL(sys_call_table);

Sigh ...

MIPS syscalls are sufficiently non-standard that so far

- NOT A SINGLE ATTEMPT at using certain syscalls like pread(2) or pwrite(2)
via the _syscall* macros from <asm/unistd.h> yet has been successful.
non-obvious enough that probably. What works on Intel doesn't necessarily
work somewhere else.
- NOT A SINGLE PIECE of code which tries itself at patching sys_call_table
ever also thought of the necessity of patching sys_narg_table.
My suggestion for the future: let's change the symbol name of
sys_call_table weekly such that nobody thinks about using it anymore.

Calling sys_something() how is ok.

Ralf

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