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

Tigran Aivazian (tigran@sco.COM)
Tue, 30 Nov 1999 09:26:30 +0000 (GMT)


On Thu, 25 Nov 1999, David Howells wrote:
> asmlinkage int sys_pipe(unsigned long * fildes)
> {
> int fd[2];
> int error;
>
> if (copy_from_user(fildes, fd, 2*sizeof(int)) ||
> copy_to_user(fildes, fd, 2*sizeof(int))
> )
> return -EFAULT;
>
> lock_kernel();
> error = do_pipe(fd);
> unlock_kernel();
> if (!error) {
> if (copy_to_user(fildes, fd, 2*sizeof(int)))
> error = -EFAULT;
> }
> return error;
> }

Ok, that is much better than both ideas I suggested (race condition and
SIGEGV). I agree that David's approach above is the best. Any other
objections?

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~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/