Re: [PATCH v2] fs: Allow opening only regular files during execve().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Morton wrote:
> > --- a/fs/open.c
> > +++ b/fs/open.c
> > @@ -733,6 +733,12 @@ static int do_dentry_open(struct file *f,
> >  		return 0;
> >  	}
> >  
> > +	/* Any file opened for execve()/uselib() has to be a regular file. */
> > +	if (unlikely(f->f_flags & FMODE_EXEC && !S_ISREG(inode->i_mode))) {
> > +		error = -EACCES;
> > +		goto cleanup_file;
> > +	}
> > +
> >  	if (f->f_mode & FMODE_WRITE && !special_file(inode->i_mode)) {
> >  		error = get_write_access(inode);
> >  		if (unlikely(error))
> 
> This change sounds legitimate for various other reasons, but it's a
> concern that this locking error occurred in the first place.  There's a
> problem somewhere (probably the pipe code) which may bite us in other
> situations, even with this workaround in place.
> 
> 

This error seems to be introduced in 2.6.39-rc1 by commit a9712bc12c40c172
("deal with races in /proc/*/{syscall,stack,personality}"). Thus, I don't
think that this patch will bite us in other situations.
Al, how do you want to handle this?



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux