lkml.org 
[lkml]   [2019]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 2/4] clone: add CLONE_PIDFD
On Wed, Apr 17, 2019 at 04:22:54PM +0200, Oleg Nesterov wrote:
> On 04/16, Christian Brauner wrote:
> >
> > + if (clone_flags & CLONE_PIDFD) {
> > + retval = pidfd_create(pid, &pidfdf);
> > + if (retval < 0)
> > + goto bad_fork_free_pid;
> > + pidfd = retval;
> > + }
>
> ...
>
> > + if (clone_flags & CLONE_PIDFD) {
> > + fd_install(pidfd, pidfdf);
> > + put_user(pidfd, parent_tidptr);
>
> put_user() can fail, I don't think this error should be silently ignored,

Yes, you're right, sorry.

> this can lead to the hard-to-trigger/debug problems.
>
> Why can't we do put_user-with-check along with pidfd_create() above?

Yes, I'll take a look where it makes sense and respin.

Christian

\
 
 \ /
  Last update: 2019-04-17 16:27    [W:0.050 / U:1.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site