Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3426333yba; Sat, 11 May 2019 10:21:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwq2PtqUTQ3rw/FAgEqNMtPYveUNq9gpFEiwz70S9jaKpkI7X5IbFAEp7+zBEgKfhT6jzC0 X-Received: by 2002:aa7:9ab0:: with SMTP id x16mr15959861pfi.201.1557595313423; Sat, 11 May 2019 10:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557595313; cv=none; d=google.com; s=arc-20160816; b=fw0r50/7Z+EvSCNnCAk9YQdeBlb/3j6FQOUXrcuWHG0vMr0S02dyFzRaAhDtYmP6UT Nzt5wrJit6PjtZNLZdPf/P9a4UKnge154WWAMJx2iI+Fuj1OBTcHX6AWbIeR0U8lRtoe +6UJn4EnYyso9aeImxsVRDc7enVe4k6e8O3b522iQm96m7xQFTvU8BUxhhkGiCG8UzAw Vfc5orK/9hBd8ArPukjTE5eBJR44vlAQCBKSMshdfINwQqzXGTbpF95XqZZMeB1f9uNP jPkPz1AiQFKerPw21BiZjvnc/BVn7+CA/uxy897uDSbYlF3A7YV/BPE7GYa/sdouhqw5 n/GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=S3OXDUOGe1RaeHY1XfZZ4bA2Wlx1tUD9aurwkeGWLLk=; b=nBygnRCThoyLsPHndn0oD74i5HTiGrQYuUf3d1nGmtG0jddHRIdTt9gVAV5uZx4awm JgoIyj8pAJfIxfm6gbDv95ZQe98ssyfhphNhumb+3nKmNw7gd2UBLwxMVx5Vq2kYnt94 Emlh+0KbQGBPh9eqh2BAY6ciDh2mAWhN2l9eIqzaUb7JuNDReRFvAHpabv0KORZi8nYa N6yJoEH+13ojz2/ZAnBTfyhnGtGH97bSZXMSPF7WF3K90IItKWmFd+A0Vs43UHBHNi+y S01Uf/8gc1LUbXSs17mx/ZoRqJgODODC/41wvIoofv4Oa4x4ImBL1+gzZJUQD7WxCSss hJjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 23si943764pgq.100.2019.05.11.10.21.39; Sat, 11 May 2019 10:21:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727576AbfEKRTo (ORCPT + 99 others); Sat, 11 May 2019 13:19:44 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:47199 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726968AbfEKRTo (ORCPT ); Sat, 11 May 2019 13:19:44 -0400 Received: from callcc.thunk.org (rrcs-67-53-55-100.west.biz.rr.com [67.53.55.100]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x4BHJaQN030274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 11 May 2019 13:19:38 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 7A41242002B; Fri, 10 May 2019 22:01:59 -0400 (EDT) Date: Fri, 10 May 2019 22:01:59 -0400 From: "Theodore Ts'o" To: Sahitya Tummala Cc: Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ext4: fix use-after-free in dx_release() Message-ID: <20190511020159.GF2534@mit.edu> Mail-Followup-To: Theodore Ts'o , Sahitya Tummala , Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org References: <1557304443-18653-1-git-send-email-stummala@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1557304443-18653-1-git-send-email-stummala@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, May 08, 2019 at 02:04:03PM +0530, Sahitya Tummala wrote: > The buffer_head (frames[0].bh) and it's corresping page can be > potentially free'd once brelse() is done inside the for loop > but before the for loop exits in dx_release(). It can be free'd > in another context, when the page cache is flushed via > drop_caches_sysctl_handler(). This results into below data abort > when accessing info->indirect_levels in dx_release(). > > Unable to handle kernel paging request at virtual address ffffffc17ac3e01e > Call trace: > dx_release+0x70/0x90 > ext4_htree_fill_tree+0x2d4/0x300 > ext4_readdir+0x244/0x6f8 > iterate_dir+0xbc/0x160 > SyS_getdents64+0x94/0x174 > > Signed-off-by: Sahitya Tummala Nice catch. Thanks, applied. - Ted