All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Boyer <jwboyer@gmail.com>
To: Jinkai Gao <mickeygjk@gmail.com>
Cc: Jan Engelhardt <jengelh@medozas.de>, linux-kernel@vger.kernel.org
Subject: Re: Suggestion: LKM should be able to add system call for itself
Date: Mon, 07 Jul 2008 10:16:51 -0400	[thread overview]
Message-ID: <1215440211.20774.48.camel@weaponx> (raw)
In-Reply-To: <fb82a8210807070700u4f191bfaq57df57c293567e4c@mail.gmail.com>

On Mon, 2008-07-07 at 10:00 -0400, Jinkai Gao wrote:
> On Mon, Jul 7, 2008 at 5:35 AM, Jan Engelhardt <jengelh@medozas.de> wrote:
> >
> > On Monday 2008-07-07 07:09, Jinkai Gao wrote:
> >
> >>LKM(loadable kernel module) was first introduced for drivers. Users
> >>rarely need to talk to the modules directly. If does, several methods
> >>are available now, such as /proc file, interruption, etc. However,
> >>these interfaces are predefined, which makes the communication between
> >>user space and kernel space quite restricted.
> >
> > And that is good -- I certainly do not want something to step out of
> > bounds by accident or intention.
> >
> >>Of course, for driver modules, these mechanisms are enough. But as
> >>long as it is called Loadable Kernel Module instead of Loadable Kernel
> >>Driver, I think it should be able to do more than that. For example,
> >>LSM(linux security module),most of which(selinux, apparmor, etc.) use
> >>policy files as their core. Users write policy files, LSM make access
> >>control decision based on the files. Seems like users don't need to
> >>talk to LSM directly. But what if user want to temporarily disable a
> >>role or capability he is holding ? Not much he can do, isn't
> >>it(although nothing is impossible, making a new system call makes much
> >>more sense).
> >
> > I do not see what a syscall will buy over a "switch file" in procfs or
> > sysfs.
> >
> >>So The LKM should be able to define its own user interface
> >>by adding new system call for itself.
> >
> > And the point is? Why cannot it use, say, a character device?
> 
> Please refer to my reply to Bart.
> 
> >>And actually,  it is not hard to
> >>implement such kind of dynamic system call table as I thought it
> >>through.
> >
> > It is. You do not know what number your syscall will get. And if
> > you knew, it might just happen that this specific number is taken
> > in the next iteration in the Linux kernel.
> 
> You are right. So we can use ascii name instead of number to identify
> the system call. Kernel will match the function with the name.To have
> backward compatibility, number should still be supported. Yes, it is
> not as easy as I thought, but as long as it is valuable and doable, we
> should have a try, right?

So you have to search a list of strings using strcmp to determine what
syscall is being called?  That would be horrible for performance.

josh


  reply	other threads:[~2008-07-07 14:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07  5:09 Suggestion: LKM should be able to add system call for itself Jinkai Gao
2008-07-07  7:01 ` Arjan van de Ven
2008-07-07 12:12   ` Jinkai Gao
2008-07-07 14:29     ` Arjan van de Ven
2008-07-07  8:40 ` Bart Van Assche
2008-07-07 12:36   ` Jinkai Gao
2008-07-07 14:16     ` Bart Van Assche
2008-07-07 14:42     ` Jan Engelhardt
2008-07-07  9:35 ` Jan Engelhardt
2008-07-07 14:00   ` Jinkai Gao
2008-07-07 14:16     ` Josh Boyer [this message]
2008-07-07 16:33       ` Eduard - Gabriel Munteanu

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=1215440211.20774.48.camel@weaponx \
    --to=jwboyer@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mickeygjk@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.