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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 CF056C432C0 for ; Tue, 19 Nov 2019 04:59:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9145C22318 for ; Tue, 19 Nov 2019 04:59:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QrgOS0ad" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9145C22318 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 340B96B026B; Mon, 18 Nov 2019 23:59:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F1C56B026C; Mon, 18 Nov 2019 23:59:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 255B16B026D; Mon, 18 Nov 2019 23:59:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 116B16B026B for ; Mon, 18 Nov 2019 23:59:35 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id C9B4982499A8 for ; Tue, 19 Nov 2019 04:59:34 +0000 (UTC) X-FDA: 76171823868.02.cork66_539a59a52bc0a X-HE-Tag: cork66_539a59a52bc0a X-Filterd-Recvd-Size: 3858 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Nov 2019 04:59:34 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 10EF8218A3; Tue, 19 Nov 2019 04:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574139573; bh=UZXvCRMhoH3K+RyN2nBmywWEVRXewXygcfqJyCQztxg=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=QrgOS0adwqP51JBSW85Jjvump3NEwGirR0TBx2iVq6+8vl+i8ZwwktvTF/LzNdrYe hgr8r1O1Tip2Tq2sc18CS/ZPV1xJZK8xB3/grynyX1mnPR5poVj+Wv8w7+rhfnGTsz v3UJfGdo8Gf9CRtGbngoMluHkJ3BIh57aJueapPM= Subject: Patch "memfd: Use radix_tree_deref_slot_protected to avoid the warning." has been added to the 4.9-stable tree To: gregkh@linuxfoundation.org,linux-mm@kvack.org,sashal@kernel.org,willy@infradead.org,yangyingliang@huawei.com,zhongjiang@huawei.com Cc: From: Date: Tue, 19 Nov 2019 05:59:31 +0100 In-Reply-To: <20191118032610.182862-4-zhongjiang@huawei.com> Message-ID: <1574139571215145@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 X-stable: commit X-Patchwork-Hint: ignore Content-Transfer-Encoding: quoted-printable 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: This is a note to let you know that I've just added the patch titled memfd: Use radix_tree_deref_slot_protected to avoid the warning. to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.g= it;a=3Dsummary The filename of the patch is: memfd-use-radix_tree_deref_slot_protected-to-avoid-the-warning.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From zhongjiang@huawei.com Tue Nov 19 05:57:08 2019 From: zhong jiang Date: Mon, 18 Nov 2019 11:26:10 +0800 Subject: memfd: Use radix_tree_deref_slot_protected to avoid the warning. To: , , , Cc: , Message-ID: <20191118032610.182862-4-zhongjiang@huawei.com> From: zhong jiang The commit 3ce6b467b9b2 ("memfd: Fix locking when tagging pins") introduces the following warning messages. *WARNING: suspicious RCU usage in memfd_wait_for_pins* It is because we still use radix_tree_deref_slot without read_rcu_lock. We should use radix_tree_deref_slot_protected instead in the case. Cc: stable@vger.kernel.org Fixes: 3ce6b467b9b2 ("memfd: Fix locking when tagging pins") Signed-off-by: zhong jiang Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Greg Kroah-Hartman --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2464,7 +2464,7 @@ static void shmem_tag_pins(struct addres =20 spin_lock_irq(&mapping->tree_lock); radix_tree_for_each_slot(slot, &mapping->page_tree, &iter, start) { - page =3D radix_tree_deref_slot(slot); + page =3D radix_tree_deref_slot_protected(slot, &mapping->tree_lock); if (!page || radix_tree_exception(page)) { if (radix_tree_deref_retry(page)) { slot =3D radix_tree_iter_retry(&iter); Patches currently in stable-queue which might be from zhongjiang@huawei.c= om are queue-4.9/misc-genwqe-should-return-proper-error-value.patch queue-4.9/memfd-use-radix_tree_deref_slot_protected-to-avoid-the-warning.= patch