dc-fukuoka/exec_cmd
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
exec_cmd - execute a user space program from the kernel space.
kernel development package is required to build.
this was tested on linux kernel 4.4, some modifications could be required for newer kernel.
please note that the executor becomes root even if a normal user is used.
$ make
$ insmod exec_cmd.ko
$ echo "<commandline>" > /proc/exec_cmd
$ rmmod exec_cmd
ex)
$ cat /tmp/test.sh
#!/bin/sh
echo $* >> /tmp/log
$ echo "/tmp/test.sh this is a test." > /proc/exec_cmd
$ cat /tmp/log
this is a test.
if debug is needed, please do "echo 1 > /sys/module/exec_cmd/parameters/debug".
some debug messages will apear in dmesg.