LKML Archive on
 help / color / Atom feed
From: Rob Landley <>
To: Ray Lee <>
Cc: Vadim Lobanov <>,,,
	David McCullough <>
Subject: Re: Feature request: exec self for NOMMU.
Date: Wed, 27 Dec 2006 16:13:51 -0500
Message-ID: <> (raw)
In-Reply-To: <>

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.)

"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

  reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-26 23:23 Rob Landley
2006-12-26 23:55 ` David Lang
2006-12-27  0:39   ` Rob Landley
2006-12-27  4:24   ` Denis Vlasenko
2006-12-27  5:44     ` Rob Landley
2006-12-27  5:13 ` Ray Lee
2006-12-27  5:51   ` Rob Landley
2006-12-27  6:08     ` Vadim Lobanov
2006-12-27  8:29       ` Rob Landley
2006-12-27 18:49         ` Ray Lee
2006-12-27 21:13           ` Rob Landley [this message]
2006-12-27 18:35   ` Denis Vlasenko
2006-12-27 21:03     ` Rob Landley
2006-12-28  2:48       ` Denis Vlasenko
2006-12-28  5:32         ` Rob Landley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone