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]
Date:   Thu, 2 Nov 2017 15:27:42 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     Pavel Tatashin <pasha.tatashin@...cle.com>
Cc:     steven.sistare@...cle.com, daniel.m.jordan@...cle.com,
        akpm@...ux-foundation.org, mgorman@...hsingularity.net,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/1] mm: buddy page accessed before initialized

On Thu 02-11-17 10:16:49, Pavel Tatashin wrote:
> > > > > Now, that memory is not zeroed, page_is_buddy() can return true after kexec
> > > > > when memory is dirty (unfortunately memset(1) with CONFIG_VM_DEBUG does not
> > > > > catch this case). And proceed further to incorrectly remove buddy from the
> > > > > list.
> > > > 
> > > > OK, I thought this was a regression from one of the recent patches. So
> > > > the problem is not new. Why don't we see the same problem during the
> > > > standard boot?
> > > 
> > > Because, I believe, BIOS is zeroing all the memory for us.
> > 
> > I thought you were runnning with the debugging which poisons all the
> > allocated memory...
> 
> Yes, but as I said, unfortunately memset(1) with CONFIG_VM_DEBUG does not
> catch this case. So, when CONFIG_VM_DEBUG is enabled kexec reboots without
> issues.

Can we make the init pattern to catch this?

> > > > > This is why we must initialize the computed buddy page beforehand.
> > > > 
> > > > Ble, this is really ugly. I will think about it more.
> > > > 
> > > 
> > > Another approach that I considered is to split loop inside
> > > deferred_init_range() into two loops: one where we initialize pages by
> > > calling __init_single_page(), another where we free them to buddy allocator
> > > by calling deferred_free_range().
> > 
> > Yes, that would make much more sense to me.
> > 
> 
> Ok, so should I submit a new patch with two loops? (The logic within loops
> is going to be the same:

Could you post it please?
 
> if (!pfn_valid_within(pfn)) {
> } else if (!(pfn & nr_pgmask) && !pfn_valid(pfn)) {
> } else if (!meminit_pfn_in_nid(pfn, nid, &nid_init_state)) {
> } else if (page && (pfn & nr_pgmask)) {
> 
> This fix was already added into mm-tree as
> mm-deferred_init_memmap-improvements-fix-2.patch

I think Andrew can drop it and replace by a different patch.

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ