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 8614DC432C0 for ; Tue, 19 Nov 2019 05:00:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 447B422318 for ; Tue, 19 Nov 2019 05:00:08 +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="DYkVOSP7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 447B422318 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 E8A7B6B026D; Tue, 19 Nov 2019 00:00:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E3B256B026E; Tue, 19 Nov 2019 00:00:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D78C36B026F; Tue, 19 Nov 2019 00:00:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id C61176B026D for ; Tue, 19 Nov 2019 00:00:07 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 767538249980 for ; Tue, 19 Nov 2019 05:00:07 +0000 (UTC) X-FDA: 76171825254.06.crib19_58540aae64003 X-HE-Tag: crib19_58540aae64003 X-Filterd-Recvd-Size: 3990 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Nov 2019 05:00:06 +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 6B49D222A4; Tue, 19 Nov 2019 05:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574139605; bh=H5XFUPtUd/psIyDQdnpsyDtdCrRIoYplGDT2f1qnVDw=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=DYkVOSP7UJUaUwlR8n3IZ52Qzo6kpCM9MWTSlrl1LtNGA/U1XajSX/F9NP7K5NQE5 3peBC67Q0mvPB7B7TH5041k2dGc4XCFTr2+UUwixMpagckqI4P6ra9wlLWSO7lWJd+ 9Y+PNZtyDVQzhEsWEQc2TRXP1wpi9PoJMbhWJyTc= Subject: Patch "memfd: Use radix_tree_deref_slot_protected to avoid the warning." has been added to the 4.19-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 06:00:03 +0100 In-Reply-To: <20191118032610.182862-2-zhongjiang@huawei.com> Message-ID: <1574139603151166@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.19-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.19 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:56:14 2019 From: zhong jiang Date: Mon, 18 Nov 2019 11:26:08 +0800 Subject: memfd: Use radix_tree_deref_slot_protected to avoid the warning. To: , , , Cc: , Message-ID: <20191118032610.182862-2-zhongjiang@huawei.com> From: zhong jiang The commit 99b45e7a1ba1 ("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: 99b45e7a1ba1 ("memfd: Fix locking when tagging pins") Signed-off-by: zhong jiang Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Greg Kroah-Hartman --- mm/memfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memfd.c +++ b/mm/memfd.c @@ -41,7 +41,7 @@ static void memfd_tag_pins(struct addres =20 xa_lock_irq(&mapping->i_pages); radix_tree_for_each_slot(slot, &mapping->i_pages, &iter, start) { - page =3D radix_tree_deref_slot(slot); + page =3D radix_tree_deref_slot_protected(slot, &mapping->i_pages.xa_lo= ck); 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.19/misc-genwqe-should-return-proper-error-value.patch queue-4.19/arm-at91-pm-call-put_device-instead-of-of_node_put-i.patch queue-4.19/coresight-use-err_cast-instead-of-err_ptr.patch queue-4.19/memfd-use-radix_tree_deref_slot_protected-to-avoid-the-warning= .patch