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: <4cf33f9c-89bc-f845-10d7-2aa62a20f5e5@huawei.com>
Date:   Thu, 12 May 2022 10:27:44 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     Rei Yamamoto <yamamoto.rei@...fujitsu.com>
CC:     <akpm@...ux-foundation.org>, <aquini@...hat.com>,
        <ddutile@...hat.com>, <linux-kernel@...r.kernel.org>,
        <linux-mm@...ck.org>, <mgorman@...hsingularity.net>,
        <vvghjk1234@...il.com>
Subject: Re: [PATCH] mm, compaction: fast_find_migrateblock() should return
 pfn in the target zone

On 2022/5/12 9:47, Rei Yamamoto wrote:
> On Wed, 11 May 2022 17:26:16 Miaohe Lin wrote:
>> On 2022/5/11 15:07, Rei Yamamoto wrote:
>>> On Wed, 11 May 2022 14:25:34 Miaohe Lin wrote:
>>>> On 2022/5/11 12:43, Rei Yamamoto wrote:
>>>>> Prevent returning a pfn outside the target zone in case that not
>>>>> aligned with pageblock boundary.
>>>>> Otherwise isolate_migratepages_block() would handle pages not in
>>>>> the target zone.
>>>>>
>>>>
>>>> IIUC, the sole caller isolate_migratepages will ensure the pfn won't outside
>>>> the target zone. So the below code change might not be necessary. Or am I miss
>>>> something ?
>>>
>>> While block_start_pfn is ensured, this variable is not used as the argument for 
>>> isolate_migratepages_block():
>>>   -----
>>>   static isolate_migrate_t isolate_migratepages(struct compact_control *cc)
>>>   {
>>>   :
>>>           low_pfn = fast_find_migrateblock(cc);
>>>           block_start_pfn = pageblock_start_pfn(low_pfn);
>>>           if (block_start_pfn < cc->zone->zone_start_pfn)
>>>                   block_start_pfn = cc->zone->zone_start_pfn;  <--- block_start_pfn is ensured not outside 
>>>                                                                     the target zone
>>>   :
>>>           block_end_pfn = pageblock_end_pfn(low_pfn);
>>>   :
>>>           for (; block_end_pfn <= cc->free_pfn;
>>>                           fast_find_block = false,
>>>                           cc->migrate_pfn = low_pfn = block_end_pfn,
>>>                           block_start_pfn = block_end_pfn,
>>>                           block_end_pfn += pageblock_nr_pages) {
>>>   :
>>>                   if (isolate_migratepages_block(cc, low_pfn, block_end_pfn,  <--- low_pfn is passed as 
>>>                                                                                    the argument
>>
>> Sorry, I think you're right. And could you please add the runtime effect of this issue?
>>
>> Anyway, this patch looks good to me now. Thanks!
> 
> Thank you for your review.
> The runtime effect is that compaction become unintended behavior.
> For example, pages not in the target zone are added to cc->migratepages list in isolate_migratepages_block().
> As a result, pages migrate between nodes unintentionally.

Many thanks for clarifying. :) Is this worth a Fixes tag or even CC stable?

Thanks!

> 
> Thanks,
> Rei
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ