Re: [patch-2.3.29] bugfix for pipe(2) system call.

Tigran Aivazian (tigran@sco.COM)
Thu, 25 Nov 1999 09:26:17 +0000 (GMT)


On Thu, 25 Nov 1999, David Howells wrote:
> I'd say there's a lot easier way of checking your pipe problem: pre-initialise
> both elements of the array to -1 or something. It's only two int's, so the
> performance penalty will be minimal.

what do you mean? You mean like this:

asmlinkage int sys_pipe(unsigned long * fildes)
{
int fd[2] = {-1, -1};
int error;

lock_kernel();
error = do_pipe(fd);
unlock_kernel();
if (!error) {
if (copy_to_user(fildes, fd, 2*sizeof(int)))
error = -EFAULT;
}
return error;
}

so what? if the user does pipe(0) she will still leak two descriptors (and
files and inodes and any other resources), won't she? I just verified this
to make sure I am not blindly missing something obvious...

So, please clarify what you mean and how it will solve the resource leak
caused by pipe(NULL) call?

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/