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: <Ywk5XE6FvP5pI5d4@ZenIV>
Date:   Fri, 26 Aug 2022 22:21:32 +0100
From:   Al Viro <viro@...iv.linux.org.uk>
To:     David Howells <dhowells@...hat.com>
Cc:     Steve French <smfrench@...il.com>,
        Shyam Prasad N <nspmangalore@...il.com>,
        Rohith Surabattula <rohiths.msft@...il.com>,
        Jeff Layton <jlayton@...nel.org>, linux-cifs@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/7] iov_iter: Add a function to extract an iter's
 buffers to a bvec iter

On Tue, Aug 23, 2022 at 03:12:14PM +0100, David Howells wrote:
> +		ret = iov_iter_get_pages2(orig, pages, count, max_pages - npages,
> +					  &start);
> +		if (ret < 0) {
> +			pr_err("Couldn't get user pages (rc=%zd)\n", ret);
> +			break;
> +		}
> +
> +		if (ret > count) {
> +			pr_err("get_pages rc=%zd more than %zu\n", ret, count);
> +			break;
> +		}
> +
> +		iov_iter_advance(orig, ret);

Have you even tested that?  iov_iter_get_pages2() advances the iterator it had been
given.  And no, it does *not* return more than it had been asked to, so the second
check is complete BS.

That's aside of the usefulness of the primitive in question...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ