From: Jeff Garzik <jgarzik@pobox.com>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Prasad <prasad_s@students.iiit.net>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: Syscall from Kernel Space
Date: Thu, 20 Feb 2003 17:17:30 -0500 [thread overview]
Message-ID: <20030220221730.GS9800@gtf.org> (raw)
In-Reply-To: <20030220221027.GA31480@x30.school.suse.de>
On Thu, Feb 20, 2003 at 11:10:27PM +0100, Andrea Arcangeli wrote:
> On Thu, Feb 20, 2003 at 12:40:43PM -0500, Jeff Garzik wrote:
> > On Thu, Feb 20, 2003 at 11:04:37PM +0530, Prasad wrote:
> > > Is there a way using which i could invoke a syscall in the kernel
> > > space? The syscall is to be run disguised as another process. The actual
> >
> > Call sys_<syscall>. Look at the kernel code for examples.
> >
> > Note that typically you don't want to do this... and you _really_ don't
> > want to do this if the syscall is not one of the common file I/O
> > syscalls (read/write/open/close, etc.)
>
> you never want to do this, the only point of a syscall is to enter
> kernel, if you're just in kernel you're wasting time in calling the
> syscall (not to tell about the new non soft interrupt based syscall
> instructions, btw this is also why I rejected the int 0x81 thing on
> x86-64 for 64bit syscalls)
He is talking about directly calling the function behind the syscall,
not actually executing a syscall itself.
The kernel already does this in various places. sys_read, sys_write,
open_filp, sys_close, and other functions are safe to call from kernel
code -- though this is discouraged. init/do_mounts.c is a particularly
annoying case, and is a big reason why klibc needs to be merged.
syscalls should be made from userspace, not the kernel.
Jeff
next prev parent reply other threads:[~2003-02-20 22:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-20 17:34 Syscall from Kernel Space Prasad
2003-02-20 17:40 ` Jeff Garzik
2003-02-20 17:49 ` Prasad
2003-02-20 22:10 ` Andrea Arcangeli
2003-02-20 22:17 ` Jeff Garzik [this message]
2003-02-20 22:45 ` Andrea Arcangeli
2003-02-21 4:39 ` Remote execution of syscalls (was Re: Syscall from Kernel Space) Prasad
2003-02-21 17:44 ` Livio Baldini Soares
2003-02-21 18:01 ` Prasad
2003-02-23 22:52 ` Pavel Machek
2003-02-25 1:34 ` H. Peter Anvin
2003-02-25 3:57 ` Prasad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030220221730.GS9800@gtf.org \
--to=jgarzik@pobox.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=prasad_s@students.iiit.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox