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: <018ee3d1-e2f0-ca12-9f63-945056c09985@kernel.dk>
Date:   Sun, 14 Jul 2019 20:33:57 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     Bharath Vedartham <linux.bhar@...il.com>,
        akpm@...ux-foundation.org, ira.weiny@...el.com, jhubbard@...dia.com
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Dimitri Sivanich <sivanich@....com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alex Williamson <alex.williamson@...hat.com>,
        Cornelia Huck <cohuck@...hat.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Björn Töpel <bjorn.topel@...el.com>,
        Magnus Karlsson <magnus.karlsson@...el.com>,
        "David S. Miller" <davem@...emloft.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        Enrico Weigelt <info@...ux.net>,
        Thomas Gleixner <tglx@...utronix.de>,
        Alexios Zavras <alexios.zavras@...el.com>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Max Filippov <jcmvbkbc@...il.com>,
        Matt Sickler <Matt.Sickler@...tronics.com>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Keith Busch <keith.busch@...el.com>,
        YueHaibing <yuehaibing@...wei.com>, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
        kvm@...r.kernel.org, linux-block@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        netdev@...r.kernel.org, bpf@...r.kernel.org,
        xdp-newbies@...r.kernel.org
Subject: Re: [PATCH] mm/gup: Use put_user_page*() instead of put_page*()

On 7/14/19 1:08 PM, Bharath Vedartham wrote:
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 4ef62a4..b4a4549 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -2694,10 +2694,9 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
>   			 * if we did partial map, or found file backed vmas,
>   			 * release any pages we did get
>   			 */
> -			if (pret > 0) {
> -				for (j = 0; j < pret; j++)
> -					put_page(pages[j]);
> -			}
> +			if (pret > 0)
> +				put_user_pages(pages, pret);
> +
>   			if (ctx->account_mem)
>   				io_unaccount_mem(ctx->user, nr_pages);
>   			kvfree(imu->bvec);

You handled just the failure case of the buffer registration, but not
the actual free in io_sqe_buffer_unregister().

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ