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=-9.8 required=3.0 tests=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=ham 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 7A5A4C432C0 for ; Tue, 19 Nov 2019 05:54:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50F9D21850 for ; Tue, 19 Nov 2019 05:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142894; bh=Y73+dY1Y0k2XuM4+cKQsdic8Xpu6IH+WkIG2UhOnRI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LY8eE5LlF4mA+XFp+ON9nSOKN5MzzTVYFoRRmacluK/wJISYrhaevjz2dFsfshs4T t7MazDZ/m+pJpeu+U+N0mgI07DZhZ1xBdUVQIoakX7e0xwRjDMY+1uzq4gl694viaT xy0RRFhvx7NmWtFj8lSKlkELCbspD2i7tFoghR5Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732205AbfKSFyx (ORCPT ); Tue, 19 Nov 2019 00:54:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:53118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731898AbfKSFyw (ORCPT ); Tue, 19 Nov 2019 00:54:52 -0500 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 1E03D2084D; Tue, 19 Nov 2019 05:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142891; bh=Y73+dY1Y0k2XuM4+cKQsdic8Xpu6IH+WkIG2UhOnRI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ExVEBqsBnyvluQDf4QV1Tuhj+mGE1JgeKlxr9Cvn0iz2uj/QuYI8TCIuSn+428ySG npx+xQrNrzQJNPyI/ZGn34mEsXjusAfzWViIzqugmWDUGPyqVcHWBl/ryzJoLAxOJu z97bNK7qOQaHGQjZu7ylFzUi8SXNuToQ4aFVJ16Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kirill Tkhai , Miklos Szeredi , Sasha Levin Subject: [PATCH 4.14 236/239] fuse: use READ_ONCE on congestion_threshold and max_background Date: Tue, 19 Nov 2019 06:20:36 +0100 Message-Id: <20191119051342.647358118@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051255.850204959@linuxfoundation.org> References: <20191119051255.850204959@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kirill Tkhai [ Upstream commit 2a23f2b8adbe4bd584f936f7ac17a99750eed9d7 ] Since they are of unsigned int type, it's allowed to read them unlocked during reporting to userspace. Let's underline this fact with READ_ONCE() macroses. Signed-off-by: Kirill Tkhai Signed-off-by: Miklos Szeredi Signed-off-by: Sasha Levin --- fs/fuse/control.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fuse/control.c b/fs/fuse/control.c index 5be0339dcceb2..42bed87dd5ea9 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -107,7 +107,7 @@ static ssize_t fuse_conn_max_background_read(struct file *file, if (!fc) return 0; - val = fc->max_background; + val = READ_ONCE(fc->max_background); fuse_conn_put(fc); return fuse_conn_limit_read(file, buf, len, ppos, val); @@ -144,7 +144,7 @@ static ssize_t fuse_conn_congestion_threshold_read(struct file *file, if (!fc) return 0; - val = fc->congestion_threshold; + val = READ_ONCE(fc->congestion_threshold); fuse_conn_put(fc); return fuse_conn_limit_read(file, buf, len, ppos, val); -- 2.20.1