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
Kconfig -rw-r--r-- 2.7 KB
Makefile -rw-r--r-- 457 bytes
addr.c -rw-r--r-- 3.9 KB
addr.h -rw-r--r-- 654 bytes
atm_misc.c -rw-r--r-- 2.6 KB
atm_sysfs.c -rw-r--r-- 4.1 KB
br2684.c -rw-r--r-- 22.8 KB
clip.c -rw-r--r-- 22.0 KB
common.c -rw-r--r-- 21.1 KB
common.h -rw-r--r-- 1.6 KB
ioctl.c -rw-r--r-- 9.2 KB
lec.c -rw-r--r-- 58.2 KB
lec.h -rw-r--r-- 5.1 KB
lec_arpc.h -rw-r--r-- 3.0 KB
mpc.c -rw-r--r-- 38.2 KB
mpc.h -rw-r--r-- 1.9 KB
mpoa_caches.c -rw-r--r-- 14.2 KB
mpoa_caches.h -rw-r--r-- 3.1 KB
mpoa_proc.c -rw-r--r-- 7.2 KB
pppoatm.c -rw-r--r-- 15.0 KB
proc.c -rw-r--r-- 9.6 KB
protocols.h -rw-r--r-- 418 bytes
pvc.c -rw-r--r-- 3.8 KB
raw.c -rw-r--r-- 2.1 KB
resources.c -rw-r--r-- 8.9 KB
resources.h -rw-r--r-- 1.1 KB
signaling.c -rw-r--r-- 6.2 KB
signaling.h -rw-r--r-- 877 bytes
svc.c -rw-r--r-- 16.0 KB

back to top