title: Connect a kernel socket to stdin and stdout
body: <p>I am working on a kernel root-kit for my Malware analysis class, one of the features of this root-kit is to create a reverse shell connection to the attacker's PC. I know how to create this in user space but, in kernel space is a different ball game. </p>
  
  <p>I am able to create sockets in kernel space and spawn user application from within the kernel, but I cannot connect the socket to STDIN or STDOUT, in user space I would simply use dup2(), but I cannot do it  kernel space. I am required to do this kernel space. Any help will be greatly appreciated.   </p>
  
  <p>I am aware that the socket structure contains a pointer to file struct, I am not sure if this is of any relevance to my project, the source code for linux/fs.h is not very helpful on providing information.</p>