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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS 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 9E18FC432C3 for ; Tue, 19 Nov 2019 04:59:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5E03422318 for ; Tue, 19 Nov 2019 04:59:52 +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="TKXzdJyq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E03422318 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 EB31D6B026C; Mon, 18 Nov 2019 23:59:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E89C66B026D; Mon, 18 Nov 2019 23:59:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC7956B026E; Mon, 18 Nov 2019 23:59:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id CCCF86B026C for ; Mon, 18 Nov 2019 23:59:51 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 8583C348D for ; Tue, 19 Nov 2019 04:59:51 +0000 (UTC) X-FDA: 76171824582.26.clam88_560639f8b6919 X-HE-Tag: clam88_560639f8b6919 X-Filterd-Recvd-Size: 3865 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Nov 2019 04:59:51 +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 AEA47222A4; Tue, 19 Nov 2019 04:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574139590; bh=rcaDxEUsZyeW9lAvYydmUneEj8EiD2wSTWWEz1iG6YY=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=TKXzdJyqc8BcB+0cL7G0BqvyacCMSHFamz4jPsjEp7zGKoH5yL1eUZrjisPBMSZOn mzocJZNkQ7w8F2kRcyZiqKPUtmrpuOopW/LLQJ9uX35xAoUwrZOKT4VOIMrE86jhvc 4S308sqM71r/nN5VgGBLNzwxBT+fKf8Q/V6ee6yw= Subject: Patch "memfd: Use radix_tree_deref_slot_protected to avoid the warning." has been added to the 4.14-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:47 +0100 In-Reply-To: <20191118032610.182862-1-zhongjiang@huawei.com> Message-ID: <1574139587136237@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.14-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.14 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:55:06 2019 From: zhong jiang Date: Mon, 18 Nov 2019 11:26:07 +0800 Subject: memfd: Use radix_tree_deref_slot_protected to avoid the warning. To: , , , Cc: , Message-ID: <20191118032610.182862-1-zhongjiang@huawei.com> From: zhong jiang The commit 391d4ee568b5 ("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: 391d4ee568b5 ("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 @@ -2664,7 +2664,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.14/misc-genwqe-should-return-proper-error-value.patch queue-4.14/memfd-use-radix_tree_deref_slot_protected-to-avoid-the-warning= .patch