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 57C30C432C0 for ; Tue, 19 Nov 2019 04:59:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1674A222A4 for ; Tue, 19 Nov 2019 04:59: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="0Hb1P+MN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1674A222A4 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 A47546B000C; Mon, 18 Nov 2019 23:59:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F6E36B0010; Mon, 18 Nov 2019 23:59:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 90C476B026B; Mon, 18 Nov 2019 23:59:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id 7AE106B000C for ; Mon, 18 Nov 2019 23:59:07 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 2759A4DDD for ; Tue, 19 Nov 2019 04:59:07 +0000 (UTC) X-FDA: 76171822734.30.jam24_4f8d6d84b7d4a X-HE-Tag: jam24_4f8d6d84b7d4a X-Filterd-Recvd-Size: 3840 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: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 0DC1C218A3; Tue, 19 Nov 2019 04:59:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574139545; bh=FrMRDNs5hEgaNJ9sJzvcvGWo6A/NeHo+V8MN15iEAmo=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=0Hb1P+MNetzZZkgl+G42yMjb7kmYbLaQbMMYOAX93/lW9aAe3YxzDrGPqNeAqAuGW u5YznsY60eIjr7LLDoswhmVKbKB2sPhTYVI8gEdE8vKPvtdUezH9fOgPLNrNuzH7y8 WxZcNErZuMigWYB6rJiiVr+xatKCYvwWNfuFjWvs= Subject: Patch "memfd: Use radix_tree_deref_slot_protected to avoid the warning." has been added to the 4.4-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:03 +0100 In-Reply-To: <20191118032610.182862-3-zhongjiang@huawei.com> Message-ID: <157413954315490@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.4-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.4 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:26 2019 From: zhong jiang Date: Mon, 18 Nov 2019 11:26:09 +0800 Subject: memfd: Use radix_tree_deref_slot_protected to avoid the warning. To: , , , Cc: , Message-ID: <20191118032610.182862-3-zhongjiang@huawei.com> From: zhong jiang The commit eb4058d8daf8 ("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: eb4058d8daf8 ("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 @@ -1862,7 +1862,7 @@ static void shmem_tag_pins(struct addres spin_lock_irq(&mapping->tree_lock); restart: 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)) goto restart; Patches currently in stable-queue which might be from zhongjiang@huawei.c= om are queue-4.4/misc-genwqe-should-return-proper-error-value.patch queue-4.4/memfd-use-radix_tree_deref_slot_protected-to-avoid-the-warning.= patch