lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75d8452c-695b-b22a-30d0-15302cd072ef@huawei.com>
Date:   Mon, 22 May 2023 09:26:50 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     "Luck, Tony" <tony.luck@...el.com>, Borislav Petkov <bp@...en8.de>,
        Naoya Horiguchi <naoya.horiguchi@....com>
CC:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "chu, jane" <jane.chu@...cle.com>
Subject: Re: [PATCH] x86/mce: set MCE_IN_KERNEL_COPYIN for all MC-Safe Copy



On 2023/5/20 0:17, Luck, Tony wrote:
>> For now, the MCE_IN_KERNEL_COPYIN flag is only set for EX_TYPE_COPY
>> and EX_TYPE_UACCESS when copy from user, and corrupted page is
>> isolated in this case, for MC-safe copy, memory_failure() is not
>> always called, some places, like __wp_page_copy_user, copy_subpage,
>> copy_user_gigantic_page and ksm_might_need_to_copy manually call
>> memory_failure_queue() to cope with such unhandled error pages,
>> recently coredump hwposion recovery support[1] is asked to do the
>> same thing, and there are some other already existed MC-safe copy
>> scenarios, eg, nvdimm, dm-writecache, dax, which has similar issue.
>>
>> The best way to fix them is set MCE_IN_KERNEL_COPYIN to MCE_SAFE
>> exception, then kill_me_never() will be queued to call memory_failure()
>> in do_machine_check() to isolate corrupted page, which avoid calling
>> memory_failure_queue() after every MC-safe copy return.
>>
>> [1] https://lkml.kernel.org/r/20230417045323.11054-1-wangkefeng.wang@huawei.com
> 
> Is this patch in addition to, or instead of, the earlier core dump patch?

This is an addition, in previous coredump patch, manually call 
memory_failure_queue()
to be asked to cope with corrupted page, and it is similar to your
"Copy-on-write poison recovery"[1], but after some discussion, I think
we could add MCE_IN_KERNEL_COPYIN to all MC-safe copy, which will
cope with corrupted page in the core do_machine_check() instead of
do it one-by-one.

The related patch is
normal page CoW [1]
huge page CoW [2]
coredump [3]
ksm might copy [4]

[1] d302c2398ba2 ("mm, hwpoison: when copy-on-write hits poison, take 
page offline")
a873dfe1032a ("mm, hwpoison: try to recover from copy-on write faults")

[2] 1cb9dc4b475c ("mm: hwpoison: support recovery from HugePage 
copy-on-write faults")

[3] 245f09226893 ("mm: hwpoison: coredump: support recovery from 
dump_user_range()")

[4] 6b970599e807 ("mm: hwpoison: support recovery from 
ksm_might_need_to_copy()")

All of them are in v6.4-rc1.

Thanks.
Kefeng

> 
> I'd like to run some tests. Can you point me a the precise set of patches
> that I should apply please?
> 
> -Tony
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ