lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871qg4za0n.wl-tiwai@suse.de>
Date:   Tue, 15 Aug 2023 15:54:16 +0200
From:   Takashi Iwai <tiwai@...e.de>
To:     Andy Shevchenko <andriy.shevchenko@...el.com>
Cc:     alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/25] ALSA: core: Add memory copy helpers between iov_iter and iomem

On Tue, 15 Aug 2023 15:51:30 +0200,
Andy Shevchenko wrote:
> 
> On Mon, Aug 14, 2023 at 01:55:01PM +0200, Takashi Iwai wrote:
> > Add two more helpers for copying memory between iov_iter and iomem,
> > which will be used by the new PCM copy ops in a few drivers.
> > The existing helpers became wrappers of those now.
> > 
> > Note that copy_from/to_iter() returns the copied bytes, hence the
> > error condition is inverted from copy_from/to_user().
> 
> ...
> 
> > -	return copy_to_user(dst, (const void __force*)src, count) ? -EFAULT : 0;
> > +	return !copy_to_iter((const void __force *)src, count, dst) ? -EFAULT : 0;
> 
> Inverted means, I believe, this
> 
> 	return copy_to_iter((const void __force *)src, count, dst) == count ? 0 : -EFAULT;
> 
> as far as I understand the idea behind the copy_to_user() return value.
> 
> Ditto for other cases.

OK, this looks more correct.  I'll fix in v2.


thanks,

Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ