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=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 B5EC7C4727F for ; Tue, 29 Sep 2020 12:42:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64A2120C09 for ; Tue, 29 Sep 2020 12:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601383331; bh=hW6fRqiJnoP0f/soN1MX0TjBN2a7bTw19nIOCeIaSt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HIfuj3pd5a+DBSLeuqhTwrb4HwroftKV9DC1mOYwKeTn4GzgD9RYZ4NUS4mL72nIL 8eA87OEgMDpf/vHvBMZ4RNEYa2lsGhZSqB2zOsYrbrrmocNC9FqqxI828wkDuR0XrH sgO3/0mcGxDPwp3LMn5QL5WL6gZihu0tgyEvqnw8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732740AbgI2MmK (ORCPT ); Tue, 29 Sep 2020 08:42:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:53384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728729AbgI2LLx (ORCPT ); Tue, 29 Sep 2020 07:11:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 84ADD2158C; Tue, 29 Sep 2020 11:11:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377913; bh=hW6fRqiJnoP0f/soN1MX0TjBN2a7bTw19nIOCeIaSt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MpLyS6VfKOcbBtG2yS8uYmsUxe7FAnkvZqGb7w2ce/rivZHlit8zpeIrBy1qlsca9 CL22EcKECZIIeNbBMssuKFDB6Ogt1refeJM0fRyFL1TzDh6V4jd2QCqMB/H8p9BX/G oypk2Ez12Ddx7WXdRPCQFZJHGSYEUh0puWR3JiD8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Wilcox , Miklos Szeredi , Sasha Levin Subject: [PATCH 4.9 087/121] fuse: dont check refcount after stealing page Date: Tue, 29 Sep 2020 13:00:31 +0200 Message-Id: <20200929105934.488374850@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105930.172747117@linuxfoundation.org> References: <20200929105930.172747117@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Miklos Szeredi [ Upstream commit 32f98877c57bee6bc27f443a96f49678a2cd6a50 ] page_count() is unstable. Unless there has been an RCU grace period between when the page was removed from the page cache and now, a speculative reference may exist from the page cache. Reported-by: Matthew Wilcox Signed-off-by: Miklos Szeredi Signed-off-by: Sasha Levin --- fs/fuse/dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index b99225e117120..f0129c033bd66 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -825,7 +825,6 @@ static int fuse_check_page(struct page *page) { if (page_mapcount(page) || page->mapping != NULL || - page_count(page) != 1 || (page->flags & PAGE_FLAGS_CHECK_AT_PREP & ~(1 << PG_locked | 1 << PG_referenced | -- 2.25.1