From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752305AbdJKXLl (ORCPT ); Wed, 11 Oct 2017 19:11:41 -0400 Received: from mga11.intel.com ([192.55.52.93]:11265 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751946AbdJKXLh (ORCPT ); Wed, 11 Oct 2017 19:11:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,363,1503385200"; d="scan'208";a="1024255912" Date: Wed, 11 Oct 2017 16:11:37 -0700 From: Andi Kleen To: Borislav Petkov Cc: "Luck, Tony" , Jeremy Cline , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Laura Abbott Subject: Re: x86/mce: suspicious RCU usage in 4.13.4 Message-ID: <20171011231137.GI5109@tassilo.jf.intel.com> References: <9840bf0d-6756-75eb-1a2d-d3aace235244@redhat.com> <20171010194426.s7keveirclglx6vh@pd.tnic> <20171010200841.uhniuwc7pulqgmic@intel.com> <871smasqux.fsf@linux.intel.com> <20171011115020.i4gkcy5pjifh2zsm@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171011115020.i4gkcy5pjifh2zsm@pd.tnic> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > - next = mce_log_get_idx_check(mcelog.next); > + next = mcelog.next; > > /* Only supports full reads right now */ > err = -EINVAL; > @@ -281,8 +266,6 @@ static ssize_t mce_chrdev_read(struct file *filp, char __user *ubuf, > next = cmpxchg(&mcelog.next, prev, 0); > } while (next != prev); > > - synchronize_sched(); Sorry I take back what I wrote earlier. This RCU is actually still needed, otherwise the reader could see partially written entries. So rather have to keep that, and change the read code to run with rcu_read_lock() -Andi