Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?]

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

 



David Howells <dhowells@xxxxxxxxxx> wrote:

> > Similarly, there appears to be no check for invalid flags in the
> > 'flags' argument of statx(). Why is there also not such a check
> > there?
> 
> Like this?
> 
> 	if (mask & STATX__RESERVED)
> 		return -EINVAL;

Sorry, I misread.  You referred to flags, not mask.  There's this in
sys_statx:

	if ((flags & AT_STATX_SYNC_TYPE) == AT_STATX_SYNC_TYPE)
		return -EINVAL;

this in vfs_statx:

	if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |
		       AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0)
		return -EINVAL;

and this in vfs_statx_fd:

	if (query_flags & ~KSTAT_QUERY_FLAGS)
		return -EINVAL;

I don't necessarily agree with that last one, but other people think it should
be there.

David



[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