Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3850176pxb; Tue, 17 Nov 2020 05:21:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBwJyfqRZKiW9ao7lcfdx13h2QsOQXj8OLFOu34pRBx66KywN8RCC1IF20S57KNSMJKcW1 X-Received: by 2002:aa7:dcd6:: with SMTP id w22mr21010354edu.19.1605619305384; Tue, 17 Nov 2020 05:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619305; cv=none; d=google.com; s=arc-20160816; b=r+isM3B9amtmSMhQy35dnGH/u6L9eVR3RbLHNuCoEDlA55+px3QoHKu40VxVAWYDsW jwCWTKqYfc2CzDdkzeUjuZc5akG3WECpKx9bR7fgI/Wx2e7itkc5TJ31rpbH2m8aNC+L 3zeoUaSqD5cfwryMxyixSlGwOP48xwRr5m7iCjw6NJGa74v9MJjZoi7gRaIq3Mj2QET+ vhR3E9tBkfksboshVw8ApGIf/hFIxNtzzLyctQgE5gdVdFEml1NJJvTcG8Iph78g/eS8 EGx/in3wo9Xt8V6qohmuPB139RxIRRxTvv8Ul4ABkG3Zbm4vqO+JRiSEetz2xdiyAoQn gkWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z+wJSzfGDTDXBju1bptnBuLzTFGbRAEtJBSvN5GMDNk=; b=zMO4g0ozZsdDgy0OIyrqnDE94R+qMQT1YFe4RlZmYQw0nUGyi8nXjrh+8fidlT6/LR ZG1SfdqtY4ZcpE/3O170zP7dslFD5IJBmunEK56q/MLUy1RwZ6XfYnzFwSrSKx8/sTih qXNAZ20+fYGUYnA2kbjJgrbmyyAgMweMqSy10cBVZJOR08Hp70k7XpFIgY2Xe10vmJA6 WkpiD/+tKG2+fOvQBGnizyJIaNEQc3SK8mgHsydIA8onx7gxHGR3nwRjm5iHWbR8h2WZ coWYX9LDu0QmozOyDMrpWHdKpg43keA92g4yGrQyNiPtI2cDbsqDwqBX3E+5JdT9ijPD o/hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AJ1Knozd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si13110673ejn.26.2020.11.17.05.21.22; Tue, 17 Nov 2020 05:21:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AJ1Knozd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730239AbgKQNTJ (ORCPT + 99 others); Tue, 17 Nov 2020 08:19:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:51250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730701AbgKQNSh (ORCPT ); Tue, 17 Nov 2020 08:18:37 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70C9821734; Tue, 17 Nov 2020 13:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619117; bh=MJC7e4m73oc8nFFfgujFgXym7uqMha9h0v2BeaSCnt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AJ1KnozdEl4ezyJWpvLYvwR7j8ssD85Mere2tzCQdUCFDqzDpMDJmBFPlI6d9mZi/ nLDuaHhyzNt4AlwD/ZLkSMNH0qWFGpZEtyubqnfQ3fDZhU26rF6R0TaqwtD3loA+Y6 S7a8NcZfBAumYB4VxcXWc6VHv3lX3pVGcMG/+jIg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Peterson , Andreas Gruenbacher , Sasha Levin Subject: [PATCH 4.19 033/101] gfs2: Add missing truncate_inode_pages_final for sd_aspace Date: Tue, 17 Nov 2020 14:05:00 +0100 Message-Id: <20201117122114.696869757@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bob Peterson [ Upstream commit a9dd945ccef07a904e412f208f8de708a3d7159e ] Gfs2 creates an address space for its rgrps called sd_aspace, but it never called truncate_inode_pages_final on it. This confused vfs greatly which tried to reference the address space after gfs2 had freed the superblock that contained it. This patch adds a call to truncate_inode_pages_final for sd_aspace, thus avoiding the use-after-free. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher Signed-off-by: Sasha Levin --- fs/gfs2/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index a971862b186e3..22cd68bd8c9b0 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -934,6 +934,7 @@ restart: gfs2_jindex_free(sdp); /* Take apart glock structures and buffer lists */ gfs2_gl_hash_clear(sdp); + truncate_inode_pages_final(&sdp->sd_aspace); gfs2_delete_debugfs_file(sdp); /* Unmount the locking protocol */ gfs2_lm_unmount(sdp); -- 2.27.0