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:   Wed, 6 Sep 2023 16:06:39 +0800
From:   Hongchen Zhang <zhanghongchen@...ngson.cn>
To:     David Hildenbrand <david@...hat.com>,
        Huacai Chen <chenhuacai@...nel.org>,
        WANG Xuerui <kernel@...0n.name>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "Mike Rapoport IBM)" <rppt@...nel.org>,
        Feiyang Chen <chenfeiyang@...ngson.cn>,
        Qi Zheng <zhengqi.arch@...edance.com>,
        "Matthew Wilcox Oracle)" <willy@...radead.org>,
        Kefeng Wang <wangkefeng.wang@...wei.com>
Cc:     loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
        loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH] LoongArch: add p?d_leaf() definitions

Hi David,

On 2023/9/6 pm 3:42, David Hildenbrand wrote:
> On 05.09.23 08:49, Hongchen Zhang wrote:
>> When I do LTP test, LTP test case ksm06 caused panic at
>>     break_ksm_pmd_entry
>>       -> pmd_leaf (Huge page table but False)
>>       -> pte_present (panic)
>>
> 
> Probably there are other problematic bits without that can trigger that? 
> I suspect walk_page_range*() callers might be affected,
I rechecked the code and found that other architectures that support
THP have defined pmd_leaf.
So there is not problem on other architectures.
> 
>> The reason is pmd_leaf is not defined, So like
>> commit 501b81046701 ("mips: mm: add p?d_leaf() definitions")
>> add p?d_leaf() definition for LoongArch.
>>
> 
> We most certainly want to cc stable, no?
OK, let me cc stable in V2.
> 
> Can we come up with a Fixes: tag? Probably when we added THP support to 
> loongarch.
OK, let me add Fixes: in commit message in V2.
> 
>> Signed-off-by: Hongchen Zhang <zhanghongchen@...ngson.cn>
>> ---
>>   arch/loongarch/include/asm/pgtable.h | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/loongarch/include/asm/pgtable.h 
>> b/arch/loongarch/include/asm/pgtable.h
>> index 370c6568ceb8..ea54653b7aab 100644
>> --- a/arch/loongarch/include/asm/pgtable.h
>> +++ b/arch/loongarch/include/asm/pgtable.h
>> @@ -243,6 +243,9 @@ static inline void pmd_clear(pmd_t *pmdp)
>>   #define pmd_phys(pmd)        PHYSADDR(pmd_val(pmd))
>> +#define pmd_leaf(pmd)        ((pmd_val(pmd) & _PAGE_HUGE) != 0)
>> +#define pud_leaf(pud)        ((pud_val(pud) & _PAGE_HUGE) != 0)
>> +
>>   #ifndef CONFIG_TRANSPARENT_HUGEPAGE
>>   #define pmd_page(pmd)        (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
>>   #endif /* CONFIG_TRANSPARENT_HUGEPAGE  */
> 
> Acked-by: David Hildenbrand <david@...hat.com>
> 


-- 
Best Regards
Hongchen Zhang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ