mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernd Petrovitsch <bernd@firmix.at>
To: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
Cc: Brian Gerst <bgerst@didntduck.org>, linux-kernel@vger.kernel.org
Subject: Re: how do you call userspace syscalls (e.g. sys_rename) from inside kernel
Date: Fri, 08 Oct 2004 17:12:51 +0200	[thread overview]
Message-ID: <1097248370.26463.0.camel@tara.firmix.at> (raw)
In-Reply-To: <20041008151837.GI5551@lkcl.net>

On Fri, 2004-10-08 at 16:18 +0100, Luke Kenneth Casson Leighton wrote:
> On Fri, Oct 08, 2004 at 10:02:08AM -0400, Brian Gerst wrote:
> > Luke Kenneth Casson Leighton wrote:
> > >could someone kindly advise me on the location of some example code in
> > >the kernel which calls one of the userspace system calls from inside the
> > >kernel?
> > >
> > >alternatively if this has never been considered before, please could
> > >someone advise me as to how it might be achieved?
> > 
> > What are you trying to do?  
> 
>  call sys_rename, sys_pread, sys_create, sys_mknod, sys_rmdir
>  etc. - everything that does file access.
> 
> > In most cases needing to use syscalls from 
> > within the kernel is an indication of a design flaw.  
> 
>  in this case it's an attempt to avoid cutting and pasting
>  the entire contents of sys_rename, sys_pread, sys_this,
>  sys_that, removing the first couple and last few lines (that
>  do copy_from_user) and replacing the arguments with either
>  a dentry or a kernel-side char* instead of an __user char*.
> 
>  my alternative is to patch every single vfs-related sys_* in fs/*.c to
>  be able to "plug in" to these functions.

Why not implement it in user-space?

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


  reply	other threads:[~2004-10-08 15:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08 13:04 Luke Kenneth Casson Leighton
2004-10-08 13:07 ` Fabiano Ramos
2004-10-08 13:38   ` Brice Goglin
2004-10-08 15:04     ` Fabiano Ramos
2004-10-08 15:35   ` Luke Kenneth Casson Leighton
2004-10-08 14:02 ` Brian Gerst
2004-10-08 15:18   ` Luke Kenneth Casson Leighton
2004-10-08 15:12     ` Bernd Petrovitsch [this message]
2004-10-08 17:03       ` Luke Kenneth Casson Leighton
2004-10-08 15:18     ` Brice Goglin
2004-10-08 16:20       ` Luke Kenneth Casson Leighton
2004-10-08 16:37         ` Jan-Benedict Glaw
2004-10-08 17:37           ` Luke Kenneth Casson Leighton
2004-10-08 15:27     ` Brian Gerst
2004-10-08 17:04       ` Luke Kenneth Casson Leighton
2004-10-12  0:15 ` Jon Masters
2004-10-12 13:16   ` Luke Kenneth Casson Leighton
2004-10-10 23:13 Aboo Valappil
2004-10-10 23:35 ` Arnd Bergmann
2004-10-11  9:56 ` Jirka Kosina

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=1097248370.26463.0.camel@tara.firmix.at \
    --to=bernd@firmix.at \
    --cc=bgerst@didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkcl@lkcl.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

all inboxes | Powered by JetHome®