From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752304AbbG3GWJ (ORCPT ); Thu, 30 Jul 2015 02:22:09 -0400 Received: from verein.lst.de ([213.95.11.211]:49326 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751013AbbG3GWH (ORCPT ); Thu, 30 Jul 2015 02:22:07 -0400 Date: Thu, 30 Jul 2015 08:22:05 +0200 From: Christoph Hellwig To: Huang Ying Cc: Christoph Hellwig , Jens Axboe , LKML , LKP ML Subject: Re: [lkp] [block] bcf2843b3f8: BUG: KASan: use after free in dio_bio_complete+0x15a/0x190 at addr ffff88001114e6f8 Message-ID: <20150730062205.GB29312@lst.de> References: <1438224799.6405.12.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438224799.6405.12.camel@intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2015 at 10:53:19AM +0800, Huang Ying wrote: > FYI, we noticed the below changes on This should fix it: diff --git a/fs/direct-io.c b/fs/direct-io.c index e1639c8..31b2d35 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -458,9 +458,10 @@ static struct bio *dio_await_one(struct dio *dio) static int dio_bio_complete(struct dio *dio, struct bio *bio) { struct bio_vec *bvec; + int error = bio->bi_error; unsigned i; - if (bio->bi_error) + if (error) dio->io_error = -EIO; if (dio->is_async && dio->rw == READ) { @@ -475,7 +476,7 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio) } bio_put(bio); } - return bio->bi_error; + return error; } /*