Re: [PATCH signal#execve2] syscalls,x86: Add execveat() system call(v3)

From: Al Viro
Date: Tue Sep 11 2012 - 21:16:51 EST

On Wed, Sep 12, 2012 at 01:55:52AM +0100, Meredydd Luff wrote:
> Al (in particular): I've reworked this on top of your generic
> execve() changes, as well as incorporating feedback from HPA.
> Could you take another look please (and merge if all is well)?
> [v3: now rebased onto signal.git#execve2, and takes a flags
> parameter which understands AT_SYMLINK_NOFOLLOW; all thanks to
> feedback from]
> HPA is already on record calling for an execveat() which also does
> fexecve()'s job:
> And the current glibc hack for fexecve() is already causing problems
> in the wild. Eg:,
>, and as recounted at

Please, declare open_execat(), leaving open_exec() as it is (i.e. a
trivial wrapper for open_execat()). Would cut down on the patch
footprint a bit...

> + bprm->filename = filename ?:
> + (const char *) file->f_path.dentry->;

Absolutely not. If nothing else, ->d_name can change on rename() *and*
get underlying memory freed. At zero notice.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at