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] [day] [month] [year] [list]
Message-ID: <ZwH8D-Hx4G7XvOUC@fedora>
Date: Sun, 6 Oct 2024 10:55:11 +0800
From: Ming Lei <ming.lei@...hat.com>
To: David Howells <dhowells@...hat.com>
Cc: Jens Axboe <axboe@...nel.dk>, Alexander Viro <viro@...iv.linux.org.uk>,
	linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
	ming.lei@...hat.com
Subject: Re: [PATCH] lib/iov_iter.c: extract virt-contiguous pages in
 iov_iter_extract_bvec_pages

On Fri, Oct 04, 2024 at 05:56:52PM +0100, David Howells wrote:
> Ming Lei <ming.lei@...hat.com> wrote:
> 
> > All iov_iter_bvec() users only want to extract virt-contiguous pages from
> > iov_iter_extract_pages() instead physical-contiguous pages.
> 
> What do you mean by "virt-contiguous"?  Virtual according to what mapping?

The term is from comment iov_iter_extract_kvec_pages(), seems it is
invented by you, :-)

Actually iov_iter_extract_pages() requires that there isn't gap in the
extracted pages, so 'offset' only exists in the 1st page, then these
pages can be mapped to one virtual(contiguous) address.

> 
> The reason for physical contiguity is that you can pass a set of physical
> contiguous pages as a single DMA descriptor.  Therefore, at some point, you
> might end up screwing up skb_splice_from_iter().  Currently, that's limited to
> a PAGE_SIZE per fragment, but hopefully that will be fixed at some point.

If any user wants to extract physical pages, new interface can be added for
returning single page instead of page array, cause it is physically contiguous.

Other kind of iterators(UBUF, KVEC, ...) do return non physically-contiguous
pages.

The point is that one bvec often point to one page except for huge page
case, so iov_iter_extract_pages() just returns single page each time
no matter how big maxpages & maxsize is passed in.

It is actually one regression:

Fixes: a7e689dd1c06 ("block: Convert bio_iov_iter_get_pages to use iov_iter_extract_pages")


Thanks,
Ming


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ