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] [day] [month] [year] [list]
Message-ID: <022fe906-054d-43b4-14d4-a4c1cb7527af@redhat.com>
Date:   Thu, 21 Apr 2022 10:50:44 +0200
From:   David Hildenbrand <david@...hat.com>
To:     "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>,
        "Hansen, Dave" <dave.hansen@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "Luck, Tony" <tony.luck@...el.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "Lutomirski, Andy" <luto@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Naoya Horiguchi <naoya.horiguchi@....com>,
        Christian Borntraeger <borntraeger@...ibm.com>
Cc:     "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        "open list:HWPOISON MEMORY FAILURE HANDLING" <linux-mm@...ck.org>,
        "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" 
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] x86/mm: Forbid the zero page once it has
 uncorrectable errors

On 21.04.22 09:53, Zhuo, Qiuxu wrote:
>> From: Hansen, Dave <dave.hansen@...el.com>
>> ...
>> Subject: Re: [PATCH 1/1] x86/mm: Forbid the zero page once it has
>> uncorrectable errors
>> ...
>> There are lots of pages which are entirely fatal if they have uncorrectable errors.
>> On my laptop, if there were an error, there is a 0.00000596% chance it will be in
>> the zero page.
>>
>> Why is this worth special casing this one page?
> 
> Hi Dave,
> 
>    Yes, this is a rare problem. Just feel that the fix is simple, so post it here to see whether you'll consider it 😊.

Just some background information.

mm_forbids_zeropage() exists for the sole purpose of s390x/kvm not being
able to use the shared zeropage for a KVM guest because the storage keys
associated with the shared zeropage could result in trouble. So
s390x/kvm has to make sure that no shared zeropage
is mapped into the process.

See fa41ba0d08de ("s390/mm: avoid empty zero pages for KVM guests to
avoid postcopy hangs") for details.

@Christian

a) with keyless guests we could actually use the shared zeropage because
the guest cannot possibly enable storage keys, correct?

b) Why is there no mm_forbids_zeropage() check in mfill_zeropage_pte()?
Maybe I'm missing something, but looks like we can still place the
shared zeropage into a KVM guest via uffd.


In general, there are more place that will use the shared zeropage, most
notably, fs/dax.c  will place the shared zeropage for holes and would
still use it on x86-64. IIRC, s390x doesn't use it.

/proc/vmcore will map the zeropage to user space for areas that are not
RAM, so you could still stumble over it there and trigger a MCE.

Last but not least, the huge shared zeropage would suffer from similar
problems.


Also, I wonder if the generic code change in mm/memory-failure.c is
correct as it touches common code and you only mess with the x86
zeropage. But I did not look into the details.


So the code here at least isn't complete. So I'm not convinced this
change is worth it.


-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ