kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: ydroneaud@opteya.com (Yann Droneaud)
To: kernelnewbies@lists.kernelnewbies.org
Subject: sysfs: pass function pointers to kernel (not just a value through attribute)
Date: Mon, 17 Dec 2012 16:32:13 +0100	[thread overview]
Message-ID: <1355758333.2397.6.camel@test.quest-ce.net> (raw)
In-Reply-To: <CAER6CkfzRtH2pG1g8pn8qohO7KSdESPNKZwFaxA73OAUWxFukg@mail.gmail.com>

Le lundi 17 d?cembre 2012 ? 10:11 -0500, Terry Hsu a ?crit :
> Hello everyone,
> 
> 
> I am looking for some mechanism for userspace tasks to pass certain
> functions to kernel and let the kernel execute these functions on
> behalf of userspace tasks. I know that sysfs can be used with kobject
> embedded into internal kernel structure to access kernel variables.
> But is there anyway for userspace tasks to pass a function to kernel
> to execute through sysfs?
> 

>From a security point of view: what a crazy idea !

And difficult to implement as you described it:
A pointer to userspace is of no interest for the kernel.
A pointer to userspace memory is tied the process that "generate" it.
So without any reference to the process, a pointer has no meaning for
the kernel.
Then, this pointer must point to something, eg. what's going to happen
when your process exit while the kernel is going to execute code on its
behalf ...

> 
> PS: adding syscall in the kernel can certainly satisfy my needs but it
> is less favorable because the new kernel service I want to add is not
> that general to be added as a new syscall.
> 

You might want to describe the problem you're trying to fix or at least
a use case.

Regards.

-- 
Yann Droneaud
OPTEYA

  reply	other threads:[~2012-12-17 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 15:11 sysfs: pass function pointers to kernel (not just a value through attribute) Terry Hsu
2012-12-17 15:32 ` Yann Droneaud [this message]
2012-12-19  0:37   ` Terry Hsu
2012-12-19 20:52 ` Jonathan Neuschäfer

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=1355758333.2397.6.camel@test.quest-ce.net \
    --to=ydroneaud@opteya.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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;
as well as URLs for NNTP newsgroup(s).