diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-06-27 13:32:19 +1000 |
---|---|---|
committer | Niv Sardi <xaiki@debian.org> | 2008-07-28 16:59:07 +1000 |
commit | 90ad58a83accbeb8de09de4a55d3e6b429767eae (patch) | |
tree | 73786e6eaf77dfe9651dc643b94b967b013c41ce /fs/xfs/linux-2.6/xfs_ioctl.c | |
parent | 07fe4dd48d046feeff8705a2a224a8fba050b1c6 (diff) | |
download | talos-obmc-linux-90ad58a83accbeb8de09de4a55d3e6b429767eae.tar.gz talos-obmc-linux-90ad58a83accbeb8de09de4a55d3e6b429767eae.zip |
[XFS] Check for invalid flags in xfs_attrlist_by_handle.
xfs_attrlist_by_handle should only take the ATTR_ flags for the root
namespaces. The ATTR_KERN* flags may change at anytime and expect special
preconditions that can't be guaranteed for userspace-originating requests.
For example passing down ATTR_KERNNOVAL through xfs_attrlist_by_handle
will hit an assert in debug builds currently.
SGI-PV: 983677
SGI-Modid: xfs-linux-melb:xfs-kern:31351a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index 01939ba2d8de..993f5720200a 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c @@ -468,6 +468,12 @@ xfs_attrlist_by_handle( if (al_hreq.buflen > XATTR_LIST_MAX) return -XFS_ERROR(EINVAL); + /* + * Reject flags, only allow namespaces. + */ + if (al_hreq.flags & ~(ATTR_ROOT | ATTR_SECURE)) + return -XFS_ERROR(EINVAL); + error = xfs_vget_fsop_handlereq(mp, parinode, &al_hreq.hreq, &inode); if (error) goto out; |