]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mce: Avoid tail copy when machine check terminated a copy from user
authorTony Luck <tony.luck@intel.com>
Tue, 6 Oct 2020 21:09:08 +0000 (14:09 -0700)
committerBorislav Petkov <bp@suse.de>
Wed, 7 Oct 2020 09:26:56 +0000 (11:26 +0200)
commitb120774b8f9e74d07d195b2f0af35de18097f3d3
treea5d030e77f79749577a87f770ee146d68d59b90d
parent19da447e403f16019631f034adb96863c3654f98
x86/mce: Avoid tail copy when machine check terminated a copy from user

In the page fault case it is ok to see if a few more unaligned bytes
can be copied from the source address. Worst case is that the page fault
will be triggered again.

Machine checks are more serious. Just give up at the point where the
main copy loop triggered the #MC and return from the copy code as if
the copy succeeded. The machine check handler will use task_work_add() to
make sure that the task is sent a SIGBUS.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20201006210910.21062-5-tony.luck@intel.com
arch/x86/lib/copy_user_64.S