提交 4d542e4c 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: reject invalid flags combinations in XFS_IOC_ATTRLIST_BY_HANDLE

While the flags field in the ABI and the on-disk format allows for
multiple namespace flags, an attribute can only exist in a single
namespace at a time. Hence asking to list attributes that exist
in multiple namespaces simultaneously is a logically invalid
request and will return no results. Reject this case early with
-EINVAL.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NChandan Rajendra <chandanrlinux@gmail.com>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 211683b2
......@@ -317,6 +317,8 @@ xfs_attrlist_by_handle(
*/
if (al_hreq.flags & ~(ATTR_ROOT | ATTR_SECURE))
return -EINVAL;
if (al_hreq.flags == (ATTR_ROOT | ATTR_SECURE))
return -EINVAL;
dentry = xfs_handlereq_to_dentry(parfilp, &al_hreq.hreq);
if (IS_ERR(dentry))
......
......@@ -375,6 +375,8 @@ xfs_compat_attrlist_by_handle(
*/
if (al_hreq.flags & ~(ATTR_ROOT | ATTR_SECURE))
return -EINVAL;
if (al_hreq.flags == (ATTR_ROOT | ATTR_SECURE))
return -EINVAL;
dentry = xfs_compat_handlereq_to_dentry(parfilp, &al_hreq.hreq);
if (IS_ERR(dentry))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册