RE: [PATCH 2/3] x86/mce: Avoid infinite loop for copy from user recovery

From: Luck, Tony
Date: Sat Jul 31 2021 - 16:49:40 EST


> After cherry picking patch 1 & 2, I saw the following with 2 UC errors injected
> into the user space buffer passed into write(2), as expected:
>
> [ 287.994754] Kernel panic - not syncing: Machine checks to different
> user pages

Interesting. What are the offsets of the two injected errors in your test (both
w.r.t. the start of the buffer, and within a page).

> The kernel tested with has its x86/mce and mm/memory-failure aligned with
> upstream till around 2020/11.
>
> Is there any other patch that I have missed to the write syscall etc?

There is a long series of patches from Al Viro to lib/iov_iter.c that are maybe
also relevent in making the kernel copy from user stop at the first poison
address in the buffer.

-Tony