Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2346003imm; Mon, 28 May 2018 06:28:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp938IBslg2N0Lqnd7G611W12vs/JX3ADuQ2LfBw/30hZuK5/R/fJuyP6N0O9+49hhhM70c X-Received: by 2002:a17:902:1025:: with SMTP id b34-v6mr13461786pla.207.1527514082787; Mon, 28 May 2018 06:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527514082; cv=none; d=google.com; s=arc-20160816; b=E4AHFJURiR0B8Mde0B1S4rmGqtt80sU8BC3Lh3VXF/Il8B4/bxibfCDr7YmmZMKSDG rX+IcZ+44JFgTSgFECaKv6wwAPrCz/gMYeZ3m8V0cWUfJ1s8aVxYIBsCwkMV21F22kqZ swuwGSBUwiCYJ4GOtlEu7Wu4uvTLJq+KPbaWm+ppnfZx34lD9QEtk/KFu0FF6BoeerZK QSnv+Lxf4QAu0cgK2RUTh3oHCX0duxzYd3Qs+8O9u/BbGOd0mw9BFvPamOcjWtOTc20R PgtwnfpmXsYUDcG1TDOBolTT6obJGsA6NEl0kumTtdLM3FiLH8ZaF3JPJOB/zfWWxdSv g9Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ADmrHzZzQNHO79IuifjPfqZOBEe89QletPwJYQ7/nTE=; b=z0A036mB9feaqawAIlCy6kEAl0V0S7kgU0s02uVXZ5IC5/46DBsPZzxi+gTc1rB91Q Rq5Asihg36fYji9boE+uAXE9XEdMkE4IxWABqQdo0ej7miAH82EpYOf6KvfRSdVM6mah HvJSG1+uXQadW1/Jf5od9PIPggHum3dS/Gf8Q5ORF/LXGZthzb4BtG9epKgyb4Q/wyfm oXkOXjYNBRNgvL2BZ0pAYNKtjOBdKGYSkSFXdzhQXonS1T1YNd48PLkMWUrLmTsl3Kzs q2tbrZfJXv1K1fyHlWZnxUo5cXEZmQhE929i1WQP8xW2nQcBHg4Mg5AlbUhl50Pb0MSp botg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gkw+aXOA; 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 g5-v6si9497871pll.525.2018.05.28.06.27.47; Mon, 28 May 2018 06:28:02 -0700 (PDT) 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=gkw+aXOA; 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 S1163352AbeE1N1C (ORCPT + 99 others); Mon, 28 May 2018 09:27:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:37738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163119AbeE1Krl (ORCPT ); Mon, 28 May 2018 06:47:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 9695120844; Mon, 28 May 2018 10:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504461; bh=4y6l2MQUudPI5yqfk36Dh1DwwAU0wZ5fHnWflvIR0f0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gkw+aXOAcE5dxhX+hy8cn8aIKSxO4nJwa0BgamW+0FbPGw8enXfexOGDHsIZDc/z5 A+/oF2klOJ7yLl1wjcXRzzoPdHbIA9xq+aXyKAMvaI+aFFjtIvaAqUKzhgQ1yF4HAi cECLR+T6iSxf7HLsg2QaHlj+4vrcFHg4H+YoHC9c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Zijlstra , Will Deacon , Al Viro , Sasha Levin Subject: [PATCH 4.14 139/496] fs: dcache: Use READ_ONCE when accessing i_dir_seq Date: Mon, 28 May 2018 11:58:44 +0200 Message-Id: <20180528100325.786426928@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon [ Upstream commit 8cc07c808c9d595e81cbe5aad419b7769eb2e5c9 ] i_dir_seq is subject to concurrent modification by a cmpxchg or store-release operation, so ensure that the relaxed access in d_alloc_parallel uses READ_ONCE. Reported-by: Peter Zijlstra Signed-off-by: Will Deacon Signed-off-by: Al Viro Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/dcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2510,7 +2510,7 @@ retry: } hlist_bl_lock(b); - if (unlikely(parent->d_inode->i_dir_seq != seq)) { + if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) { hlist_bl_unlock(b); rcu_read_unlock(); goto retry;