Thread (4 messages) 4 messages, 3 authors, 2012-12-19

sysfs: pass function pointers to kernel (not just a value through attribute)

From: Yann Droneaud <hidden>
Date: 2012-12-17 15:32:13

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help