Re: do_execve().

From: Tigran Aivazian (tigran@veritas.com)
Date: Fri May 05 2000 - 08:45:30 EST


On Fri, 5 May 2000, Paul Burkacki wrote:
> Greetings,
>
> I am tryimg to execute do_execve() from within a driver to
> trigger execution of a script in user mode. The call fails
> with -14 (EFAULT, I believe). I *think* I am setting up all
> arguments for do_execve() correctly but, since I haven't found
> any examples of its use, I am not sure.
>
> Could anyone point me to where I could find exmples of how to
> correctly call do_execve()? I am particularly curious about
> envp and pt_regs.
>
> Any help is greatly appreciated.

are you doing:

mm_segment_t old_fs;

old_fs = get_fs();
set_fs(KERNEL_DS);
....do_execve()
set_fs(old_fs);

around the call to do_execve(). You are passing it kernel addresses and it
expects (some ofthem, namely argv and envp) to be user addresses.

An example is - look how copy_strings_kernel() differs from
copy_strings() to understand it.

Regards,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:17 EST