Execute shell command in kernel module

前端 未结 3 880
半阙折子戏
半阙折子戏 2021-02-10 03:18

Is it possible to execute shell command in kernel module. I know that we can do it in user space C code using system subroutine.
I am debugging a kernel module

3条回答
  •  迷失自我
    2021-02-10 04:08

    You can't run a shell command in a kernel module. Code in a kernel module can cause a command to be run, but it will run in a normal user process.

    free will be of little help with kernel memory leaks.
    It would be much better to wrap all allocations and frees in your kernel code, and maintain a counter of allocated memory.

提交回复
热议问题