mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: DM <dm.n9107@gmail.com>
To: "Ulrich Drepper" <drepper@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	linux-mips@linux-mips.org, sparclinux@vger.kernel.org,
	torvalds@linux-foundation.org
Subject: Re: [PATCH v2] unify sys_pipe implementation
Date: Mon, 5 May 2008 10:30:09 +0200	[thread overview]
Message-ID: <5eeb9ad90805050130i39ae791dwe599c12fc08fb8ec@mail.gmail.com> (raw)
In-Reply-To: <200805031801.m43I109q032242@devserv.devel.redhat.com>

On Sat, May 3, 2008 at 8:01 PM, Ulrich Drepper <drepper@redhat.com> wrote:
[...]
>   /*
>  + * sys_pipe() is the normal C calling standard for creating
>  + * a pipe. It's not the way Unix traditionally does this, though.
>  + */
>  +asmlinkage long sys_pipe(int __user *fildes)
>  +{
>  +       int fd[2];
>  +       int error;
>  +
>  +       error = do_pipe(fd);
>  +       if (!error) {
>  +               if (copy_to_user(fildes, fd, sizeof(fd)))
>  +                       error = -EFAULT;
>  +       }
>  +       return error;
>  +}
>  +
[...]

I realize this code is old, but wouldn't file descriptors leak if
copy_to_user fails?

BR,
dm.n9107

  parent reply	other threads:[~2008-05-05  8:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03 18:01 Ulrich Drepper
2008-05-03 18:40 ` Linus Torvalds
2008-05-05  8:30 ` DM [this message]
2008-05-05  9:15   ` Michael Kerrisk
2008-05-05 10:18   ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5eeb9ad90805050130i39ae791dwe599c12fc08fb8ec@mail.gmail.com \
    --to=dm.n9107@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®