Message ID | 20200422095020.115861367@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=aqQR=6G=vger.kernel.org=stable-owner@kernel.org> 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 0B332C5518A for <stable@archiver.kernel.org>; Wed, 22 Apr 2020 10:15:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE42A20575 for <stable@archiver.kernel.org>; Wed, 22 Apr 2020 10:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587550500; bh=8Zkwt3Nxc5a6mdUgf20I8irYrlccMGLwx42I/QawL/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LWOLlU5U2BFo0YL3UbI/+qY1enDhz964UejWOUJxtgbLDCK0Xge/cs4pJE9Nw7v1h m/3yv00ES28yEatIdOs8bdhTCJ4MZ+OtsY29UslC4velr50N7mBgmK++gDcOQztv3F 83DBTT4qFtXek4c6XolZlcHPzEPIfmYYA70gAS5g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729614AbgDVKO7 (ORCPT <rfc822;stable@archiver.kernel.org>); Wed, 22 Apr 2020 06:14:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:49916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729221AbgDVKO5 (ORCPT <rfc822;stable@vger.kernel.org>); Wed, 22 Apr 2020 06:14:57 -0400 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 AE9192071E; Wed, 22 Apr 2020 10:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587550497; bh=8Zkwt3Nxc5a6mdUgf20I8irYrlccMGLwx42I/QawL/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUhFWSawIlg85+gWj+WFiBcZDj0q6ItpQT+DLgz8+PnICKgCs1okkXFoQlnw66sno BWewKJ+Y9sLSYXjl0w/hR/NgzJql/hmqVwRyD/xs/hXlXfOkrkb2Z3xvOnrWgdKoTC 68c4ru0cToWp8nx/CCh6SmAVDTqxXj3K49kqAeF0= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Qian Cai <cai@lca.pw>, Andrew Morton <akpm@linux-foundation.org>, Marco Elver <elver@google.com>, Linus Torvalds <torvalds@linux-foundation.org>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 4.19 40/64] percpu_counter: fix a data race at vm_committed_as Date: Wed, 22 Apr 2020 11:57:24 +0200 Message-Id: <20200422095020.115861367@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095008.799686511@linuxfoundation.org> References: <20200422095008.799686511@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: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 4f052496cdfd7..0a4f54dd4737b 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h @@ -78,9 +78,9 @@ static inline s64 percpu_counter_read(struct percpu_counter *fbc) */ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) { - s64 ret = fbc->count; + /* Prevent reloads of fbc->count */ + s64 ret = READ_ONCE(fbc->count); - barrier(); /* Prevent reloads of fbc->count */ if (ret >= 0) return ret; return 0;