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: <20190415151146.GA3436@redhat.com>
Date:   Mon, 15 Apr 2019 11:11:46 -0400
From:   Jerome Glisse <jglisse@...hat.com>
To:     "Yan, Zheng" <zyan@...hat.com>
Cc:     linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-block@...r.kernel.org, linux-mm@...ck.org,
        John Hubbard <jhubbard@...dia.com>, Jan Kara <jack@...e.cz>,
        Dan Williams <dan.j.williams@...el.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Johannes Thumshirn <jthumshirn@...e.de>,
        Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
        Ming Lei <ming.lei@...hat.com>,
        Dave Chinner <david@...morbit.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Matthew Wilcox <willy@...radead.org>,
        Sage Weil <sage@...hat.com>, Ilya Dryomov <idryomov@...il.com>,
        ceph-devel@...r.kernel.org
Subject: Re: [PATCH v1 15/15] ceph: use put_user_pages() instead of
 ceph_put_page_vector()

On Mon, Apr 15, 2019 at 03:46:59PM +0800, Yan, Zheng wrote:
> On 4/12/19 5:08 AM, jglisse@...hat.com wrote:
> > From: Jérôme Glisse <jglisse@...hat.com>
> > 
> > When page reference were taken through GUP (get_user_page*()) we need
> > to drop them with put_user_pages().
> > 
> > Signed-off-by: Jérôme Glisse <jglisse@...hat.com>
> > Cc: linux-fsdevel@...r.kernel.org
> > Cc: linux-block@...r.kernel.org
> > Cc: linux-mm@...ck.org
> > Cc: John Hubbard <jhubbard@...dia.com>
> > Cc: Jan Kara <jack@...e.cz>
> > Cc: Dan Williams <dan.j.williams@...el.com>
> > Cc: Alexander Viro <viro@...iv.linux.org.uk>
> > Cc: Johannes Thumshirn <jthumshirn@...e.de>
> > Cc: Christoph Hellwig <hch@....de>
> > Cc: Jens Axboe <axboe@...nel.dk>
> > Cc: Ming Lei <ming.lei@...hat.com>
> > Cc: Dave Chinner <david@...morbit.com>
> > Cc: Jason Gunthorpe <jgg@...pe.ca>
> > Cc: Matthew Wilcox <willy@...radead.org>
> > Cc: Yan Zheng <zyan@...hat.com>
> > Cc: Sage Weil <sage@...hat.com>
> > Cc: Ilya Dryomov <idryomov@...il.com>
> > Cc: ceph-devel@...r.kernel.org
> > ---
> >   fs/ceph/file.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> > index 6c5b85f01721..5842ad3a4218 100644
> > --- a/fs/ceph/file.c
> > +++ b/fs/ceph/file.c
> > @@ -667,7 +667,8 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to,
> >   			} else {
> >   				iov_iter_advance(to, 0);
> >   			}
> > -			ceph_put_page_vector(pages, num_pages, false);
> > +			/* iov_iter_get_pages_alloc() did call GUP */
> > +			put_user_pages(pages, num_pages);
> 
> pages in pipe were not from get_user_pages(). Am I missing anything?

Oh my mistake i miss-read iov_iter_is_pipe() and iov_iter_get_pages_alloc()
missed the special case for pipe before iterate_all_kinds() Thanks for
catching that.

Cheers,
Jérôme

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ