From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78C0CC4727E for ; Thu, 1 Oct 2020 23:39:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A3A4420796 for ; Thu, 1 Oct 2020 23:39:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="lzDnxSkm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3A4420796 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A9EB56B0062; Thu, 1 Oct 2020 19:39:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A4EE96B006C; Thu, 1 Oct 2020 19:39:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 965CF6B0070; Thu, 1 Oct 2020 19:39:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0146.hostedemail.com [216.40.44.146]) by kanga.kvack.org (Postfix) with ESMTP id 644C96B0062 for ; Thu, 1 Oct 2020 19:39:46 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 042EF8249980 for ; Thu, 1 Oct 2020 23:39:46 +0000 (UTC) X-FDA: 77324976372.06.grain94_4f157e22719f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id D227510151731 for ; Thu, 1 Oct 2020 23:39:45 +0000 (UTC) X-HE-Tag: grain94_4f157e22719f X-Filterd-Recvd-Size: 2388 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Thu, 1 Oct 2020 23:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=3sNwD3fS2AygWs26RYRBHxcXTkCx29Q9BPV20sehQXg=; b=lzDnxSkmvbWTo/fVhd8smCX8an 8aFs/eq+VaQuW2frkHDz5dKhaUwpacnta+RqminJICFx3GMg8GFKpNVWwy6KL4S60MRaqGJcHUI+z OuwzY5UClxWfZL1pey0tU+sFnuigCcBln+DolcU9wiF+pwKSsRmp9bBhHVi5pwTGG0hiU8p+/1/G7 GwYSFILiFhIeng+4MHqr3zipD9yCHAyFYaAKVaaXfcNiYAsQCHC2UuPHm5QblG54QKHUd07nJJ1hR tjBBzaNi1pKpLA/j8/9g6hxGMIHewxEG4ETV4lGKHAsa9BY6WiQHSxx1cHtz2OTP0k6rmIS+GC5KK OcU2H2lg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO8Ap-000246-D1; Thu, 01 Oct 2020 23:39:43 +0000 Date: Fri, 2 Oct 2020 00:39:43 +0100 From: Matthew Wilcox To: Andrew Morton Cc: linux-mm@kvack.org Subject: xarray-add-xas_split-fix-3.patch Message-ID: <20201001233943.GW20115@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Testing today revealed a rather annoying bug where we can free an initialised node back to the slab cache without zeroing it first. That ends up creating a corrupted XArray ... whichever XArray happens to allocate that node next. >From c53d4d2690db946f5710a39e6a6f67c5a46ff9a4 Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Thu, 1 Oct 2020 18:22:35 -0400 Subject: [PATCH] fix xarray --- lib/xarray.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/xarray.c b/lib/xarray.c index b573db455c43..eedb4b51c59f 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -271,8 +271,7 @@ static void xas_destroy(struct xa_state *xas) while (node) { XA_NODE_BUG_ON(node, !list_empty(&node->private_list)); next = rcu_dereference_raw(node->parent); - /* XXX: need to free children */ - kmem_cache_free(radix_tree_node_cachep, node); + radix_tree_node_rcu_free(&node->rcu_head); xas->xa_alloc = node = next; } } -- 2.28.0