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: <5d9f2080-7020-d3f0-73cc-ae2af0943303@redhat.com>
Date:   Thu, 22 Jul 2021 16:54:29 +1000
From:   Gavin Shan <gshan@...hat.com>
To:     Anshuman Khandual <anshuman.khandual@....com>, linux-mm@...ck.org
Cc:     linux-kernel@...r.kernel.org, catalin.marinas@....com,
        will@...nel.org, akpm@...ux-foundation.org, chuhu@...hat.com,
        shan.gavin@...il.com
Subject: Re: [PATCH v3 12/12] mm/debug_vm_pgtable: Fix corrupted page flag

Hi Anshuman,

On 7/22/21 1:51 PM, Anshuman Khandual wrote:
> Small nit:
> 
> s/Fix corrupted page flag/Fix page flag corruption on arm64/
> 

Sure, The replacement will be applied in v4, thanks!

> On 7/21/21 5:33 PM, Gavin Shan wrote:
>> Hi Anshuman,
>>
>> On 7/21/21 8:18 PM, Anshuman Khandual wrote:
>>> On 7/19/21 6:36 PM, Gavin Shan wrote:
>>>> In page table entry modifying tests, set_xxx_at() are used to populate
>>>> the page table entries. On ARM64, PG_arch_1 is set to the target page
>>>> flag if execution permission is given. The page flag is kept when the
>>>> page is free'd to buddy's free area list. However, it will trigger page
>>>> checking failure when it's pulled from the buddy's free area list, as
>>>> the following warning messages indicate.
>>>>
>>>>      BUG: Bad page state in process memhog  pfn:08000
>>>>      page:0000000015c0a628 refcount:0 mapcount:0 \
>>>>           mapping:0000000000000000 index:0x1 pfn:0x8000
>>>>      flags: 0x7ffff8000000800(arch_1|node=0|zone=0|lastcpupid=0xfffff)
>>>>      raw: 07ffff8000000800 dead000000000100 dead000000000122 0000000000000000
>>>>      raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
>>>>      page dumped because: PAGE_FLAGS_CHECK_AT_PREP flag(s) set
>>>>
>>>> This fixes the issue by clearing PG_arch_1 through flush_dcache_page()
>>>> after set_xxx_at() is called.
>>>
>>> Could you please add comments before each flush_dcache_page() instance
>>> explaining why this is needed for arm64 platforms with relevant PG_arch_1
>>> context and how this does not have any adverse effect on other platforms ?
>>> It should be easy for some one looking at this code after a while to figure
>>> out from where flush_dcache_page() came from.
>>>
>>
>> Good point. I will improve chage log to include the commit ID in v4 where the
>> page flag (PG_arch_1) is used and explain how. In that case, it's much clearer
>> to understand the reason why we need flush_dcache_page() after set_xxx_at() on
>> ARM64.
> 
> But also some in code comments where flush_dcache_page() is being called.
> 

Yes, I will add some comments where flush_dcache_page() is called in v4.

Thanks,
Gavin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ