mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	xfs: in _attrlist_by_handle, copy the cursor back to userspace
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: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
		
							parent
							
								
									f2bdfda9a1
								
							
						
					
					
						commit
						0facef7fb0
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -387,6 +387,7 @@ xfs_attrlist_by_handle(
 | 
			
		|||
{
 | 
			
		||||
	int			error = -ENOMEM;
 | 
			
		||||
	attrlist_cursor_kern_t	*cursor;
 | 
			
		||||
	struct xfs_fsop_attrlist_handlereq __user	*p = arg;
 | 
			
		||||
	xfs_fsop_attrlist_handlereq_t al_hreq;
 | 
			
		||||
	struct dentry		*dentry;
 | 
			
		||||
	char			*kbuf;
 | 
			
		||||
| 
						 | 
				
			
			@ -419,6 +420,11 @@ xfs_attrlist_by_handle(
 | 
			
		|||
	if (error)
 | 
			
		||||
		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))
 | 
			
		||||
		error = -EFAULT;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue