Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp875099pxk; Thu, 17 Sep 2020 20:00:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJrovoRpZGNXjFebBbKdpx/f4DJinCMH5ZqzIXyVR5/2F964oY6eCrCwjlB43Dk0kaplJC X-Received: by 2002:a17:906:7fca:: with SMTP id r10mr33436855ejs.534.1600398036037; Thu, 17 Sep 2020 20:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398036; cv=none; d=google.com; s=arc-20160816; b=xYAS9Mm8bQn9OdW8JWpzYcxvWVtp13VkxkKQ6x5gdTUke2T3l62OsdzGmqSWVgBATX HtcSQsWwkGHPslVyNGtfIkzoNr5kLV+tebjzRwbeiN3G+QVUuybqlKF/GEocFN0uOM5c q9QXDqmKlI9lgspwBUvRT5H0uzsMKSUpETD3w5XFipcgFszIrL6HAIqHHykudwcC+IwT BEuqiOhiXxFMxKjIKfokjLPMXtJXW5W6z2tG1kA5CdQ/1YoHWWeGzwA6VWml8fFKsdBu rRv8gpiOt2LVCCz8aKK9MLxY/8e/0xyM8vR9xn0c9z4m16ovSEx1wDug3NNQPLywpY+F AFEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HqwHm0/N9Epl3SMHTlf0ZTqRSMcOSqxT4yz7Y2wpfv4=; b=lj/Z77XjOVAiemWIYpW8KP1b7XW49onj2zmZnryMj9EZ0+O8dxs5dME4P4D3OTes89 ORekAfMYe2MHeqGxJeUOs2JrQ4jOduhfCoNLMiOkYcprcW0ewgAqQ64cuOY6TQZmuBI5 jNUhYG8q1Ey1/DQcOm1VsFH0WuzpwpSuMxIj1eUQ1/sTSY7O4SWvZvhRcH9GWICvQnis uOKOF+6vkeXhi9LrkAETeOZtqlotKoqFOJUKcGpDCafykKZlKkzaJbP0XEohMbfAczM0 o72mqow9xn4FEJRnPjqCQfVpNuBeyP2iHeQYRAX8YuNACS5bBkMFBJ5ogGNVW/kDvRG3 ETeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jc9f+nCQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si1111705edt.19.2020.09.17.20.00.12; Thu, 17 Sep 2020 20:00:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jc9f+nCQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727804AbgIRC46 (ORCPT + 99 others); Thu, 17 Sep 2020 22:56:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:56486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbgIRCGt (ORCPT ); Thu, 17 Sep 2020 22:06:49 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0B31238E5; Fri, 18 Sep 2020 02:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394803; bh=hWxEemS0CtcU8+GmrUgxR9sUWie9zveuyVgl/2YQdms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jc9f+nCQFXXFqKUYGhS4trw59OWh14hNnCO/GUrtuQzwFKo293uGLLhhFGdoMPhWP CE1pIDE8uVl7MkhM5n8Uu9To30MmtGVwGIcd6/F+pwPVfr8mgKzRInhC1UCEN7emLz 0My3ldMazIDtqzWZs6yW1/a09gyt6L6Pp+vqwY3I= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Miklos Szeredi , Matthew Wilcox , Sasha Levin , fuse-devel@lists.sourceforge.net Subject: [PATCH AUTOSEL 5.4 272/330] fuse: don't check refcount after stealing page Date: Thu, 17 Sep 2020 22:00:12 -0400 Message-Id: <20200918020110.2063155-272-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 06dd38e76c62a..f9022b7028754 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -764,7 +764,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