Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp12536pja; Fri, 22 Nov 2019 02:47:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyvvHNGl2XBuq0nubj4UMoUGPj0cE9wpq7iqGAzBZ5xUQxWNWDnWw3d7gMlz0hfcnWNyDtx X-Received: by 2002:a17:906:d793:: with SMTP id pj19mr21224879ejb.303.1574419668569; Fri, 22 Nov 2019 02:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574419668; cv=none; d=google.com; s=arc-20160816; b=eGYQoiXWQIcrDOc9ap3Ecfl+2WQvFVI2qZBem48XEdjoFNVBePl07WlJf7wQnXCCX6 /fK3qA14oaALy4GmUt0aJ54ETS3lCJVTUxiY0wCBpkllfD/I4AY8cZSUSgbSXOY6bn11 +S2eN+AW6l4oedG8+lngGzMLJkTtpS2HmUaNpNNb6JJ4pgPsg5YOfu0IZn0e7gCi9I/o BrGtz+3Lc3H+D9HJmoEllqyWNR9Jc7Ywc1jh439Aq5RdiBsxGASVrSaPJCH2LZby9xkp 0l+KAkITwLLVRdaeLXwq8WQt5Nu1dMMH1nXbpmTJ2+n7GWwVpv93KomSFXl3THpWm/gd Sz9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kjp4sBW80iDmp5ouVBhyDK1y2QtC/I2wzFVKxfdo5T0=; b=DO4d/wU4P5Xfi1SdUpaPV0SHP7bw/3MR3z/Gmhm2j4+elyr5ZyxWMYzvagVxNZK6zd 8omhpNRRLFWsbrDepn9iXRM9zCy5f13Kbd/fhRabY11JxtwnDriTZpfQAEuRfABlul23 mBCXlYayi0y7yjitA+ccvF+deRu/9Nar3yPvYaCPWs5NZ6/X7hR3JCWLzgOevpyheuX1 8M5pXgzDwuB8WHYKpRGL17SB7Sbhy6BpdnpA3zt93yYyVFjiPd+bM1AIXgWgM6kKEbGS eYz36HeuZWDhFYWMA1j9aP8TAg/jekezfShR3JG4tHjrdXofWr5sjrMEhCbbz53Y+m1i +Z+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bOff5lxY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h43si1629291edb.89.2019.11.22.02.47.24; Fri, 22 Nov 2019 02:47:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bOff5lxY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728851AbfKVKph (ORCPT + 99 others); Fri, 22 Nov 2019 05:45:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:52002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729486AbfKVKpd (ORCPT ); Fri, 22 Nov 2019 05:45:33 -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 354A820715; Fri, 22 Nov 2019 10:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574419532; bh=8iD2RbErPWDnc+352S6Dt9T6EhXU+MLXptMB07sJbVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bOff5lxYhu9lpNhM/KUg+6LN7y/ehJcxyjzIh/WnfZaO1L5bRpokXJDiUHkMAtWQQ NhtxV3HccCzRJrvdJXsKz1KVuJxHwYI+SCDNZy9cXgXuQpOvYGkEmsuLtCgOzoqo6K 8O2LWEyrUaWhdX2QxOVqjPkx69Am5SgovXIm6LVQ= 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.9 144/222] fuse: use READ_ONCE on congestion_threshold and max_background Date: Fri, 22 Nov 2019 11:28:04 +0100 Message-Id: <20191122100913.230281494@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100830.874290814@linuxfoundation.org> References: <20191122100830.874290814@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 e25c40c10f4fa..97ac2f5843fcc 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