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
| ||
|
Message-ID: <20191211025318.457113-16-jhubbard@nvidia.com> Date: Tue, 10 Dec 2019 18:53:08 -0800 From: John Hubbard <jhubbard@...dia.com> To: Andrew Morton <akpm@...ux-foundation.org> CC: Al Viro <viro@...iv.linux.org.uk>, Alex Williamson <alex.williamson@...hat.com>, Benjamin Herrenschmidt <benh@...nel.crashing.org>, Björn Töpel <bjorn.topel@...el.com>, Christoph Hellwig <hch@...radead.org>, Dan Williams <dan.j.williams@...el.com>, Daniel Vetter <daniel@...ll.ch>, Dave Chinner <david@...morbit.com>, David Airlie <airlied@...ux.ie>, "David S . Miller" <davem@...emloft.net>, Ira Weiny <ira.weiny@...el.com>, Jan Kara <jack@...e.cz>, Jason Gunthorpe <jgg@...pe.ca>, Jens Axboe <axboe@...nel.dk>, Jonathan Corbet <corbet@....net>, Jérôme Glisse <jglisse@...hat.com>, Magnus Karlsson <magnus.karlsson@...el.com>, "Mauro Carvalho Chehab" <mchehab@...nel.org>, Michael Ellerman <mpe@...erman.id.au>, Michal Hocko <mhocko@...e.com>, Mike Kravetz <mike.kravetz@...cle.com>, "Paul Mackerras" <paulus@...ba.org>, Shuah Khan <shuah@...nel.org>, Vlastimil Babka <vbabka@...e.cz>, <bpf@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>, <kvm@...r.kernel.org>, <linux-block@...r.kernel.org>, <linux-doc@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>, <linux-media@...r.kernel.org>, <linux-rdma@...r.kernel.org>, <linuxppc-dev@...ts.ozlabs.org>, <netdev@...r.kernel.org>, <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>, John Hubbard <jhubbard@...dia.com> Subject: [PATCH v9 15/25] fs/io_uring: set FOLL_PIN via pin_user_pages() Convert fs/io_uring to use the new pin_user_pages() call, which sets FOLL_PIN. Setting FOLL_PIN is now required for code that requires tracking of pinned pages, and therefore for any code that calls put_user_page(). In partial anticipation of this work, the io_uring code was already calling put_user_page() instead of put_page(). Therefore, in order to convert from the get_user_pages()/put_page() model, to the pin_user_pages()/put_user_page() model, the only change required here is to change get_user_pages() to pin_user_pages(). Reviewed-by: Jens Axboe <axboe@...nel.dk> Reviewed-by: Jan Kara <jack@...e.cz> Signed-off-by: John Hubbard <jhubbard@...dia.com> --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 405be10da73d..9639ebc21e8a 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4521,7 +4521,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg, ret = 0; down_read(¤t->mm->mmap_sem); - pret = get_user_pages(ubuf, nr_pages, + pret = pin_user_pages(ubuf, nr_pages, FOLL_WRITE | FOLL_LONGTERM, pages, vmas); if (pret == nr_pages) { -- 2.24.0
Powered by blists - more mailing lists