Revision 171936ddaf97e6f4e1264f4128bb5cf15691339c authored by Tony Luck on 25 June 2021, 01:39:55 UTC, committed by Linus Torvalds on 25 June 2021, 02:40:54 UTC
Patch series "mm,hwpoison: fix sending SIGBUS for Action Required MCE", v5.

I wrote this patchset to materialize what I think is the current
allowable solution mentioned by the previous discussion [1].  I simply
borrowed Tony's mutex patch and Aili's return code patch, then I queued
another one to find error virtual address in the best effort manner.  I
know that this is not a perfect solution, but should work for some
typical case.

[1]: https://lore.kernel.org/linux-mm/20210331192540.2141052f@alex-virtual-machine/

This patch (of 2):

There can be races when multiple CPUs consume poison from the same page.
The first into memory_failure() atomically sets the HWPoison page flag
and begins hunting for tasks that map this page.  Eventually it
invalidates those mappings and may send a SIGBUS to the affected tasks.

But while all that work is going on, other CPUs see a "success" return
code from memory_failure() and so they believe the error has been
handled and continue executing.

Fix by wrapping most of the internal parts of memory_failure() in a
mutex.

[akpm@linux-foundation.org: make mf_mutex local to memory_failure()]

Link: https://lkml.kernel.org/r/20210521030156.2612074-1-nao.horiguchi@gmail.com
Link: https://lkml.kernel.org/r/20210521030156.2612074-2-nao.horiguchi@gmail.com
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Aili Yao <yaoaili@kingsoft.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jue Wang <juew@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent fe19bd3
History
File Mode Size
Makefile -rw-r--r-- 294 bytes
af_rose.c -rw-r--r-- 36.9 KB
rose_dev.c -rw-r--r-- 2.9 KB
rose_in.c -rw-r--r-- 7.3 KB
rose_link.c -rw-r--r-- 6.4 KB
rose_loopback.c -rw-r--r-- 2.8 KB
rose_out.c -rw-r--r-- 2.6 KB
rose_route.c -rw-r--r-- 30.4 KB
rose_subr.c -rw-r--r-- 12.1 KB
rose_timer.c -rw-r--r-- 4.5 KB
sysctl_net_rose.c -rw-r--r-- 3.1 KB

back to top