Re: execute a user process in the kernel

From: Chris Pressey (cpressey_at_catseye.mine.nu)
Date: 09/23/04

  • Next message: Bruce M Simpson: "Re: Global (non _KERNEL) place for sockaddr_union?"
    Date: Wed, 22 Sep 2004 23:17:24 -0700
    To: freebsd-hackers@freebsd.org
    
    

    On Wed, 22 Sep 2004 18:46:49 -0400
    Allan Fields <bsd@afields.ca> wrote:

    > On Wed, Sep 22, 2004 at 08:49:11AM +0000, Gordon David wrote:
    > > Hello,
    > >
    > > I have a question. Anyone would like to tell me how to execute a
    > > user process or shell script in the kernel?
    >
    > You probably really don't want to do this and if you do, there is
    > likely a better approach.

    Reading between the lines and guessing - here's what you can do:

    Write a userland program that (1) reads /dev/fooctl, (2) does something
    based on what it got from /dev/fooctl, and (3) goes back to step (1).

    Then write a kernel driver that produces output on /dev/fooctl every
    time it wants the userland program to do something.

    This achieves the effect you (probably) want while maintaining the
    seperation between kernel and userland.

    HTH,
    -Chris
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Bruce M Simpson: "Re: Global (non _KERNEL) place for sockaddr_union?"

    Relevant Pages

    • Re: Execute user program from kernel
      ... I have a both a kernel module and a user program. ... From user space you can execute a program with system, ... "No, the kernel cannot start a user process, only ...
      (comp.os.linux.development.system)
    • Re: Execute user program from kernel
      ... Who else but the kernel can start a user process to execute ... Mygoodness. ...
      (comp.os.linux.development.system)
    • Re: yet another Forth: vmForth
      ... and MidLevel and HLL all Integrated in the Kernel. ... VM assembler and simulator from within the simulator for testing :-) ... higher level Forth constructs, like jz/jnz, lit, execute, call and jump. ... Compiles VM assembler mnemonics into the VM memory. ...
      (comp.lang.forth)
    • Re: Communications kernel -> userland
      ... > form the kernel to the user process; ... > to the user process memory. ... > handle packets, perhaps ...
      (freebsd-hackers)
    • Re: [Full-Disclosure] Linux Exec Shield (was: Linux (in)security)
      ... > Speaking about kernel hardening, I was wondering if anyone on the list could ... > comment on Ingo Molnar's Exec Shield Linux kernel patches. ... Linux kernel you can execute any data inside a process's memory or overwrite ... From a security point of view ...
      (Full-Disclosure)