Re: fcntl F_SETOWN correct?

Alan Cox (alan@lxorguk.ukuu.org.uk)
Fri, 28 May 1999 17:39:09 +0100 (BST)


> filp->f_owner.pid = arg;
> filp->f_owner.uid = current->uid;
> filp->f_owner.euid = current->euid;
> if (S_ISSOCK (filp->f_dentry->d_inode->i_mode))
> err = sock_fcntl (filp, F_SETOWN, arg);
> break;
>
> It looks like no validation is done when setting the 'pid' field.
>
> Is this correct, or should it check to make sure the pid is valid, and
> owned by the current user?

You have to do the signal checks at delivery time. A pid is only a temporary
cookie. The pid may get recycled

-
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/