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: <aCfxs5CiHYMJPOsy@mini-arch>
Date: Fri, 16 May 2025 19:17:23 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
	willemb@...gle.com, sagi@...mberg.me, asml.silence@...il.com,
	almasrymina@...gle.com, kaiyuanz@...gle.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: devmem: remove min_t(iter_iov_len) in
 sendmsg

On 05/17, Al Viro wrote:
> On Fri, May 16, 2025 at 06:24:03PM -0700, Stanislav Fomichev wrote:
> > On 05/17, Al Viro wrote:
> > > On Fri, May 16, 2025 at 05:04:31PM -0700, Stanislav Fomichev wrote:
> > > > iter_iov_len looks broken for UBUF. When iov_iter_advance is called
> > > > for UBUF, it increments iov_offset and also decrements the count.
> > > > This makes the iterator only go over half of the range (unless I'm
> > > > missing something).
> > > 
> > > What do you mean by "broken"?  iov_iter_len(from) == "how much data is
> > > left in that iterator".  That goes for all flavours, UBUF included...
> > > 
> > > Confused...
> 
> [snip]
> 
> > iov_len. And now, calling iter_iov_len (which does iov_len - iov_offset)
> 
> Wait a sec...  Sorry, I've misread that as iov_iter_count(); iter_iov_len()
> (as well as iter_iov_addr()) should not be used on anything other that
> ITER_IOVEC
> 
> <checks>
> 
> Wait, in the same commit there's
> +       if (iov_iter_type(from) != ITER_IOVEC)
> +               return -EFAULT;
> 
> shortly prior to the loop iter_iov_{addr,len}() are used.  What am I missing now?

Yeah, I want to remove that part as well:

https://lore.kernel.org/netdev/20250516225441.527020-1-stfomichev@gmail.com/T/#u

Otherwise, sendmsg() with a single IOV is not accepted, which makes not
sense.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ