Re: [PATCH v2 1/1] s390/crash: allow multi-segment iterators

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

 



On Thu, Jul 07, 2022 at 02:31:44PM +0100, Al Viro wrote:
> > @@ -73,10 +73,9 @@ int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count)
> >  		}
> >  		offset = src % PAGE_SIZE;
> >  		bytes = min(PAGE_SIZE - offset, count);
> > -		if (copy_to_user(dest, hsa_buf + offset, bytes))
> > +		if (copy_to_iter(hsa_buf + offset, bytes, iter) != bytes)
> >  			return -EFAULT;
> 
> Umm...  Then you want iov_iter_revert() on short copy...

... maybe better to change the calling convention to return the short
write and have the caller do it if they care?



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux