Re: x86/mce: suspicious RCU usage in 4.13.4

From: Andi Kleen
Date: Wed Oct 11 2017 - 19:11:46 EST


> - 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