Return-Path: Received: from mga06.intel.com ([134.134.136.31]:25673 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728111AbeLJPfD (ORCPT ); Mon, 10 Dec 2018 10:35:03 -0500 Date: Mon, 10 Dec 2018 08:32:30 -0700 From: Keith Busch To: Bart Van Assche Cc: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , Todd Aiken , Laurence Oberman , stable@vger.kernel.org Subject: Re: [PATCH] block: Restore tape support Message-ID: <20181210153230.GB25206@localhost.localdomain> References: <20181210030814.13235-1-bvanassche@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181210030814.13235-1-bvanassche@acm.org> Sender: stable-owner@vger.kernel.org List-ID: 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); } --