Re: access_ok inside kernelspace

Tigran Aivazian (tigran@sco.COM)
Tue, 19 Oct 1999 11:41:22 +0100 (BST)


Dear Ingo,

I agree that it should be (and is now) possible to use system calls from
within system calls (i.e. by going through int 0x80 via _syscallX().
However, some of the examples you give have nothing to do with this issue.

On Tue, 19 Oct 1999, Ingo Molnar wrote:
> some users of this feature: exec() is using fop->read()
that is not going through _syscallX(), that is just using a function
pointer visible indirectly.

> sys_ustat() is internally using ->statfs()
same as above.

> autofs is using ->write().
kNFSd is using
> ->read(), ->write(), ->readlink(), ->statfs(). NBD, loopback, etc.
same as above.

> this is a regular kernel feature, it gives us flexibility to reuse already
> existing functionality internally.
yes, reusing the methods that filesystems (or others) provide is a good
thing. Going through int 0x80 is *also* a good thing. But they are two
completely different things.

> there are even 'deeper' calls than calls to sys_*(), eg. khttpd is using
> the socket layer quite directly, to do ->recvmsg(), ->sendmsg(), ->read()
> without any demultiplexing overhead and it's using internal socket-layer
> data structures directly. [it uses other system calls as well, but only
> those need set_fs()/get_fs() which are interacting with user-space VM]

Yes, but you have not shown a single case of calling system calls from
within system calls (or from withing any other part of the kernel) via
sys_XXX functions. I presume there are none (on i386 architecture)?

All I said is that if the kernel wants to call a system call then it
should go through _syscallX() macros. All known to me examples do just
that. (but on alpha they do call sys_XXX() functions which is a bit
inconsistent but I am sure there is a reason for that).

Of course the examples you gave are valid usages of kernel functions
via indirect pointers but NOT of using the system calls.

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran

-
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/