From patchwork Wed Mar 9 03:52:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 8541991 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B0F0D9F46A for ; Wed, 9 Mar 2016 03:53:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D50B92014A for ; Wed, 9 Mar 2016 03:53:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06DEF2020F for ; Wed, 9 Mar 2016 03:53:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751618AbcCIDxE (ORCPT ); Tue, 8 Mar 2016 22:53:04 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:34099 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040AbcCIDxC (ORCPT ); Tue, 8 Mar 2016 22:53:02 -0500 Received: by mail-pa0-f52.google.com with SMTP id fe3so12418270pab.1 for ; Tue, 08 Mar 2016 19:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=GE0wDrZjpsED3GwettSsYUvfsIcNwuwo2sJrjXMUJr8=; b=ZceW712bvNSHMpRWynoOdFSEWGL70utGwUI5G1UnnSCp0OaKNgTyZy4/Zq4JxLSMNM IJ9/uCJBfH+uUyUAUIsIwrXVVTnXZjSSA93LkE968ABXj+B0cbhMSmfMDPjYCCy1nBbc WreaNaZxkXFGBJworQxdLA4bS8UlB8JHA97zzDuVOp3DJUC4aEZeWGruKX41rt5CJ2fp eH+biM0ft8CqMy+7uLwOPRKammVznSjALqO3JCrK5SLK59O7ePbi9TfsbCyj0w83qxY2 9etSQVkMPMKBGGcdS0BP2AU2Srq55OpYNxpbXe6geC03aOMFo4drAICR7WQJTpqo2mce FPdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=GE0wDrZjpsED3GwettSsYUvfsIcNwuwo2sJrjXMUJr8=; b=AN395ShF6sP6KCRQegJU2i3y+CXIYCdsnHFoowGRGnGwLA0e5ELsY8CPMEtePrg8gb th06phxKSBwo4Egcnrga3abRTIAXZRP232x1ii9Hybt2wwujefAX1fLr7GJyYkMaUr75 g3QA5AbTYxa4b1x6nVF+Ddfi5hl3zRhsCQ3CKklL9ukAZzwkx7mRjGsznVtbaBPsA35e TQ8Z6eES7VM3sJvLXNMwXbWoOrjn22A4OECbToi55s5Hc8lgThMhyU2b2eMzK4T04mXq rsHg292NN/VHlWNByWQSPKTfoS2LPFE2DScZbjztrnndPWInFk+unCDF0/78xbY/kZ3F cH7A== X-Gm-Message-State: AD7BkJJcLrIjYIsMrFb/nRqc3mNyNjb/Teg2+xvzb5teN9BR2gRnQ7oECmY4XEc3M6q55g== X-Received: by 10.66.185.227 with SMTP id ff3mr47128491pac.117.1457495581631; Tue, 08 Mar 2016 19:53:01 -0800 (PST) Received: from kmo-pixel (213-168-42-72.gci.net. [72.42.168.213]) by smtp.gmail.com with ESMTPSA id ql1sm8192662pac.24.2016.03.08.19.53.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Mar 2016 19:53:00 -0800 (PST) Date: Tue, 8 Mar 2016 18:52:58 -0900 From: Kent Overstreet To: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH] direct-io: fix use after free Message-ID: <20160309035258.GA311@kmo-pixel> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Kent Overstreet --- fs/direct-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/direct-io.c b/fs/direct-io.c index 1b2f7ffc8b..d6a9012d42 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -472,8 +472,8 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio) dio->io_error = -EIO; if (dio->is_async && dio->rw == READ && dio->should_dirty) { - bio_check_pages_dirty(bio); /* transfers ownership */ err = bio->bi_error; + bio_check_pages_dirty(bio); /* transfers ownership */ } else { bio_for_each_segment_all(bvec, bio, i) { struct page *page = bvec->bv_page;