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: <f50b438f-90bc-36b1-c943-18d7a4b3f441@redhat.com>
Date:   Mon, 12 Jun 2023 20:15:44 +0200
From:   David Hildenbrand <david@...hat.com>
To:     David Howells <dhowells@...hat.com>, Jens Axboe <axboe@...nel.dk>,
        kernel test robot <oliver.sang@...el.com>
Cc:     Christoph Hellwig <hch@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
        Jeff Layton <jlayton@...nel.org>,
        Jason Gunthorpe <jgg@...dia.com>,
        Logan Gunthorpe <logang@...tatee.com>,
        Hillf Danton <hdanton@...a.com>,
        Christian Brauner <brauner@...nel.org>,
        Lorenzo Stoakes <lstoakes@...il.com>,
        linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
        linux-mm@...ck.org, oe-lkp@...ts.linux.dev, lkp@...el.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: Fix dio_bio_alloc() to set BIO_PAGE_PINNED

On 12.06.23 18:51, David Howells wrote:
>      
> Fix dio_bio_alloc() to set BIO_PAGE_PINNED, not BIO_PAGE_REFFED, so that
> the bio code unpins the pinned pages rather than putting a ref on them.
> 
> The issue was causing:
> 
>          WARNING: CPU: 6 PID: 2220 at mm/gup.c:76 try_get_folio
> 
> This can be caused by creating a file on a loopback UDF filesystem, opening
> it O_DIRECT and making two writes to it from the same source buffer.
> 
> Fixes: 1ccf164ec866 ("block: Use iov_iter_extract_pages() and page pinning in direct-io.c")
> Reported-by: kernel test robot <oliver.sang@...el.com>
> Closes: https://lore.kernel.org/oe-lkp/202306120931.a9606b88-oliver.sang@intel.com
> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Christoph Hellwig <hch@...radead.org>
> cc: David Hildenbrand <david@...hat.com>
> cc: Andrew Morton <akpm@...ux-foundation.org>
> cc: Jens Axboe <axboe@...nel.dk>
> cc: Al Viro <viro@...iv.linux.org.uk>
> cc: Matthew Wilcox <willy@...radead.org>
> cc: Jan Kara <jack@...e.cz>
> cc: Jeff Layton <jlayton@...nel.org>
> cc: Jason Gunthorpe <jgg@...dia.com>
> cc: Logan Gunthorpe <logang@...tatee.com>
> cc: Hillf Danton <hdanton@...a.com>
> cc: Christian Brauner <brauner@...nel.org>
> cc: Linus Torvalds <torvalds@...ux-foundation.org>
> cc: linux-fsdevel@...r.kernel.org
> cc: linux-block@...r.kernel.org
> cc: linux-kernel@...r.kernel.org
> cc: linux-mm@...ck.org
> ---
>   fs/direct-io.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/direct-io.c b/fs/direct-io.c
> index 14049204cac8..04e810826ee8 100644
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -415,7 +415,8 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio,
>   	else
>   		bio->bi_end_io = dio_bio_end_io;
>   	/* for now require references for all pages */

Does the comment still hold?

> -	bio_set_flag(bio, BIO_PAGE_REFFED);
> +	if (dio->need_unpin)
> +		bio_set_flag(bio, BIO_PAGE_PINNED);
>   	sdio->bio = bio;
>   	sdio->logical_offset_in_bio = sdio->cur_page_fs_offset;
>   }
> 

-- 
Cheers,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ