Commit 1b03d85a authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Greg Kroah-Hartman

xfs: in _attrlist_by_handle, copy the cursor back to userspace

commit 0facef7f upstream.

When we're iterating inode xattrs by handle, we have to copy the
cursor back to userspace so that a subsequent invocation actually
retrieves subsequent contents.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
Cc: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c56605c6
...@@ -403,6 +403,7 @@ xfs_attrlist_by_handle( ...@@ -403,6 +403,7 @@ xfs_attrlist_by_handle(
{ {
int error = -ENOMEM; int error = -ENOMEM;
attrlist_cursor_kern_t *cursor; attrlist_cursor_kern_t *cursor;
struct xfs_fsop_attrlist_handlereq __user *p = arg;
xfs_fsop_attrlist_handlereq_t al_hreq; xfs_fsop_attrlist_handlereq_t al_hreq;
struct dentry *dentry; struct dentry *dentry;
char *kbuf; char *kbuf;
...@@ -435,6 +436,11 @@ xfs_attrlist_by_handle( ...@@ -435,6 +436,11 @@ xfs_attrlist_by_handle(
if (error) if (error)
goto out_kfree; goto out_kfree;
if (copy_to_user(&p->pos, cursor, sizeof(attrlist_cursor_kern_t))) {
error = -EFAULT;
goto out_kfree;
}
if (copy_to_user(al_hreq.buffer, kbuf, al_hreq.buflen)) if (copy_to_user(al_hreq.buffer, kbuf, al_hreq.buflen))
error = -EFAULT; error = -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment