Re: [PATCH v2] proc: fix races against execve() of /proc/PID/fd**
From: Vasiliy Kulikov
Date: Sun Aug 28 2011 - 05:32:51 EST
Hi Cyrill,
On Sun, Aug 28, 2011 at 13:25 +0400, Cyrill Gorcunov wrote:
> On Sat, Aug 27, 2011 at 11:01:47PM +0400, Vasiliy Kulikov wrote:
> ...
> >
> > +static int proc_pid_fd_link_getattr(struct vfsmount *mnt, struct dentry *dentry,
> > + struct kstat *stat)
> > +{
> > + struct inode *inode = dentry->d_inode;
> > + struct task_struct *task = get_proc_task(inode);
> > + int rc;
> > +
>
> Are we sure if the task will be always valid here?
>
> if (!task)
> return -ENOENT;
No, you're right. It needs (task == NULL) check. Thank you!
--
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/