Re: Feature request: exec self for NOMMU.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 27 December 2006 1:49 pm, Ray Lee wrote:
> >>> I haven't got a man page for fexecve.  Does libc have it?
> >> It's implemented inside glibc, and uses /proc to execve() the file that
> >> the fd points to.
> 
> Oh, hmm. Then I think it won't work, will it? I'd assumed fexecve was
> implemented in kernel.

It sort of is.  Through the /proc filesystem, the kernel provides a path 
through which to open any arbitrary file descriptor, thus providing 
the "path" argument that the exec syscall requires.

> > Cute, and I can do that.  Assuming /proc is mounted in the chroot 
> > environment...
> 
> Maybe I'm just confused -- wouldn't be the first time -- but if it's
> implemented inside userspace, then once you chroot() you won't be able
> to execute the path you find via /proc, will you?

You need /proc mounted in the new chroot for it to work.  It's not a complete 
solution, but an incremental improvement over the previous hack.

Of course today what you can do is copy busybox into the top directory of the 
new chroot directory, execute that via the standard chroot command, 
run "/busybox mount -n -t procfs /proc /proc", and then let the 
current /proc/self/exe logic handle things from there.  (Or configure busybox 
to use /busybox instead of /proc/self/exe as the re-exec-self path.)

Rob
-- 
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux