sys_execve() from kernelspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello.
is it generally possible to execute userspace programs through a module's
kernel thread?

i tried the following:
first of all i copied the code of sys_execve() into one of my module headers.
init_module then sets up the needed execve arguments in a struct, the kernel
thread is executed by init_module.
all that goes smoothly.
from within the kernel thread i apply the trick of changing the addr_limit
to not let sys_execve() return -14. that value means
"EFAULT filename points outside your accessible address space"

then sys_execve() is called. the call to it returns a value of zero. the manpage of execve says that
the call to execve never returns and on an error -1 is returned.
so with zero, the called program executed already and is done?
(the program i called, namely "/bin/ping", shouldnt have returned that fast in my case).

is it possible to prevent that from happening?

thanks for your time!
threadhead


_____________________________________________________________________
Endlich SMS mit Bildern versenden! Das Bild selbst ist dabei gratis,
Sie bezahlen lediglich den Versand. http://freemail.web.de/?mc=021195


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux