Return-Path: Received: from mail-qt1-f196.google.com ([209.85.160.196]:41271 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbeLJQRH (ORCPT ); Mon, 10 Dec 2018 11:17:07 -0500 Received: by mail-qt1-f196.google.com with SMTP id d18so12863112qto.8 for ; Mon, 10 Dec 2018 08:17:06 -0800 (PST) Message-ID: <1544458624.18488.2.camel@redhat.com> Subject: Re: [PATCH] block: Restore tape support From: Laurence Oberman To: Jens Axboe , Keith Busch , Bart Van Assche Cc: linux-block@vger.kernel.org, Christoph Hellwig , Todd Aiken , stable@vger.kernel.org Date: Mon, 10 Dec 2018 11:17:04 -0500 In-Reply-To: <93112026-a6b3-6db4-0c74-afbbbf6ca493@kernel.dk> References: <20181210030814.13235-1-bvanassche@acm.org> <20181210153230.GB25206@localhost.localdomain> <93112026-a6b3-6db4-0c74-afbbbf6ca493@kernel.dk> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: On Mon, 2018-12-10 at 08:36 -0700, Jens Axboe wrote: > On 12/10/18 8:32 AM, Keith Busch wrote: > > On Sun, Dec 09, 2018 at 07:08:14PM -0800, Bart Van Assche wrote: > > > According to what I found in > > > https://bugzilla.kernel.org/show_bug.cgi?id=201935 patch "block: > > > Clear > > > kernel memory before copying to user" broke tape access. Hence > > > revert > > > that patch. > > > > Instead of reverting back to the leaking arbitrary kernel memory, > > why > > not just make a fix on top of it? This should do it: > > > > --- > > diff --git a/block/bio.c b/block/bio.c > > index c4ef8aa46452..55a5386fd431 100644 > > --- a/block/bio.c > > +++ b/block/bio.c > > @@ -1262,7 +1262,8 @@ struct bio *bio_copy_user_iov(struct > > request_queue *q, > >   if (ret) > >   goto cleanup; > >   } else { > > - zero_fill_bio(bio); > > + if (bmd->is_our_pages) > > + zero_fill_bio(bio); > >   iov_iter_advance(iter, bio->bi_iter.bi_size); > >   } > >   > > That should be fine, the other case is user mapped memory anyway. > OK, I will test this today Thanks folks!! Laurence