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, 26 Sep 2019 15:14:46 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Qian Cai <cai@....pw>, Michal Hocko <mhocko@...nel.org>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Oscar Salvador <osalvador@...e.de>,
        Pavel Tatashin <pasha.tatashin@...een.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v1] mm/memory_hotplug: Don't take the cpu_hotplug_lock

On 26.09.19 15:02, Qian Cai wrote:
> On Thu, 2019-09-26 at 13:52 +0200, Michal Hocko wrote:
>> On Thu 26-09-19 07:19:27, Qian Cai wrote:
>>>
>>>
>>>> On Sep 26, 2019, at 3:26 AM, Michal Hocko <mhocko@...nel.org> wrote:
>>>>
>>>> OK, this is using for_each_online_cpu but why is this a problem? Have
>>>> you checked what the code actually does? Let's say that online_pages is
>>>> racing with cpu hotplug. A new CPU appears/disappears from the online
>>>> mask while we are iterating it, right? Let's start with cpu offlining
>>>> case. We have two choices, either the cpu is still visible and we update
>>>> its local node configuration even though it will disappear shortly which
>>>> is ok because we are not touching any data that disappears (it's all
>>>> per-cpu). Case when the cpu is no longer there is not really
>>>> interesting. For the online case we might miss a cpu but that should be
>>>> tolerateable because that is not any different from triggering the
>>>> online independently of the memory hotplug. So there has to be a hook
>>>> from that code path as well. If there is none then this is buggy
>>>> irrespective of the locking.
>>>>
>>>> Makes sense?
>>>
>>> This sounds to me requires lots of audits and testing. Also, someone who is more
>>> familiar with CPU hotplug should review this patch.
>>
>> Thomas is on the CC list.
>>
>>> Personally, I am no fun of
>>> operating on an incorrect CPU mask to begin with, things could go wrong really
>>> quickly...
>>
>> Do you have any specific arguments? Just think of cpu and memory
>> hotplugs being independent operations. There is nothing really
>> inherently binding them together. If the cpu_online_mask really needs a
>> special treatment here then I would like to hear about that. Handwaving 
>> doesn't really helps us.
> 
> That is why I said it needs CPU hotplug experts to confirm that things including
> if CPU masks are tolerate to this kind of "abuse", or in-depth analysis of each 
> calls sites that access CPU masks in both online_pages() and offline_pages() as
> well as ideally, more testing data in those areas.
> 
> However, many kernel commits were merged with the expectations that people are
> going to deal with the aftermath, so I am not going to insist.
> 

I am going to add documentation to build_all_zonelists() regarding
locking and the details we discussed.

Of course, I'll do more testing, and as Michal suggested, we should let
this "mature" in linux-next for some time.

-- 

Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ