Skip to contentSkip to conversation

How to duplicate arbitrary process via an LKM

DISCUSSION Curtis Taylor 1 participant 1 message Sep 19, 2013

lore
Share & tools
lore
#0 lore raw

Hello all,

I'm wondering if it's possible to create an LKM that can take an arbitrary process, removes it from the run queue, duplicates it, and re-runs it with it's new PID. I would like to see the functionality of a simple user space fork() but I don't want to edit the application's source code.

I'm new to writing kernel code and after looking at a kernel dev book, it looks like the system calls clone or do_fork would be what I would leverage for this. The problem is that clone expects some user space data data in order to work, but maybe it's possible I could look at the task struct and figure out everything I need?

Please 'cc' me with responses as I'm not on the mailing list.

Thanks in advance!