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, 20 Jun 2019 09:18:41 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Yang Shi <yang.shi@...ux.alibaba.com>,
        Michal Hocko <mhocko@...nel.org>
Cc:     akpm@...ux-foundation.org, mgorman@...hsingularity.net,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Eric Dumazet <edumazet@...gle.com>,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] mm: mempolicy: handle vma with unmovable pages mapped
 correctly in mbind

On 6/19/19 8:19 PM, Yang Shi wrote:
>>>> This is getting even more muddy TBH. Is there any reason that we 
>>>> have to
>>>> handle this problem during the isolation phase rather the migration?
>>> I think it was already said that if pages can't be isolated, then
>>> migration phase won't process them, so they're just ignored.
>>
>> Yes,exactly.
>>
>>> However I think the patch is wrong to abort immediately when
>>> encountering such page that cannot be isolated (AFAICS). IMHO it should
>>> still try to migrate everything it can, and only then return -EIO.
>>
>> It is fine too. I don't see mbind semantics define how to handle such 
>> case other than returning -EIO.

I think it does. There's:
If MPOL_MF_MOVE is specified in flags, then the kernel *will attempt to
move all the existing pages* ... If MPOL_MF_STRICT is also specified,
then the call fails with the error *EIO if some pages could not be moved*

Aborting immediately would be against the attempt to move all.

> By looking into the code, it looks not that easy as what I thought. 
> do_mbind() would check the return value of queue_pages_range(), it just 
> applies the policy and manipulates vmas as long as the return value is 0 
> (success), then migrate pages on the list. We could put the movable 
> pages on the list by not breaking immediately, but they will be ignored. 
> If we migrate the pages regardless of the return value, it may break the 
> policy since the policy will *not* be applied at all.

I think we just need to remember if there was at least one page that
failed isolation or migration, but keep working, and in the end return
EIO if there was such page(s). I don't think it breaks the policy. Once
pages are allocated in a mapping, changing the policy is a best effort
thing anyway.

>>
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ