A look at the source code for Linux kernel 2.0.30 and an attempted
exploit seem to show that linux clone() does not have the weakness
discovered in rfork().
An excerpt from linux/fs/exec.c (lines 516ff in my copy):
if (id_change) {
/* We can't suid-execute if we're sharing parts of the * executable */
/* or if we're being traced (or if suid execs are not allowed) */
/* (current->mm->count > 1 is ok, as we'll get a new mm anyway) */
if (IS_NOSUID(bprm->inode)
|| (current->flags & PF_PTRACED)
|| (current->fs->count > 1)
|| (current->sig->count > 1)
|| (current->files->count > 1)) /*XXX jepler*/ {
if (!suser())
return -EPERM;
}
}
XXX marks the line which keeps us safe in the face of CLONE_FILES.
Copies of my non-exploit are available on reques.
Jeff
-- \/ jepler@inetnebr.com http://incolor.inetnebr.com/jepler/ (0|1(01*0)*1)+ HOW YOU CAN TELL THAT IT'S GOING TO BE A ROTTEN DAY: #1040 Your income tax refund cheque bounces.