lkml.org 
[lkml]   [1999]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch-2.3.29] bugfix for pipe(2) system call.
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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.020 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site