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,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 DC585C432C0 for ; Tue, 19 Nov 2019 06:01:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADAA0206DA for ; Tue, 19 Nov 2019 06:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574143313; bh=blpqi0RXovzkfLlmQ9MMcwXtTOCskwWkjcijEU41dFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0vVydhkVPne+4Fy9ScTKmKRdOvIfDvhj0GhFVZACUgMLKBIOn6fxUvdfDuEAHMgjS KJKt/8RLaYaudc8A3JWSv2ASAKRRYa+SEwRv/mntXj7kqDGe6j6Q+b1F5wLxOGd6ed k2RhhT5DZLbzcpC/CKa4QyVnHhY6KbG+kFGid4E8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730712AbfKSFnS (ORCPT ); Tue, 19 Nov 2019 00:43:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:37846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730364AbfKSFnC (ORCPT ); Tue, 19 Nov 2019 00:43:02 -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 0C94A21783; Tue, 19 Nov 2019 05:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142182; bh=blpqi0RXovzkfLlmQ9MMcwXtTOCskwWkjcijEU41dFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NUQZGFBR36lTQSzyqLBYUk7UhRsUV/PYTPeTL5OdBz1aTkWOOBUtGgZuX5hDti8Pb ipOIXXhJtaz9iOT/AHsbw4z95tLBqAr3xNkSETrdOEyFh9q4c0l0SJJbByAQ2+QGe/ BRRalr7iFuVF/5GCPTOXHPZnPCKiaSuNr+UMB/yo= 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.19 417/422] fuse: use READ_ONCE on congestion_threshold and max_background Date: Tue, 19 Nov 2019 06:20:14 +0100 Message-Id: <20191119051426.217491591@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051400.261610025@linuxfoundation.org> References: <20191119051400.261610025@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 0b694655d9880..acc35819aae64 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