Re: Executing user-space program from an LKM

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

 




On Feb 27, 2006, at 3:02 PM, Vincenzo Mallozzi wrote:

Hi all,
I've searched for this argument but I've not found
something I need.
The question is: how can I execute an user-space
process from within a module?
I've noticed that the do_exec function have an
argument with type struct pt_regs but I ignore the way
I can use them.
Can anyone help me?

Vincenzo Mallozzi




You DON'T use do_exec() at all.

Use instead proper usermode helper: call_usermodehelper() / call_usermodehelper_keys().
Remember that:
- you must call it in a valid process context
- the process run as root
- in older kernel you can't wait for user space program to terminate

check kernel/kmod.c

-----------
Oldani (sgrakkyu) Massimiliano

Antifork Research, Inc.
Metro Olografix


--
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