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-next>] [day] [month] [year] [list]
Message-Id: <1651131333-6386-1-git-send-email-zhanghongchen@loongson.cn>
Date:   Thu, 28 Apr 2022 15:35:33 +0800
From:   Hongchen Zhang <zhanghongchen@...ngson.cn>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Alistair Popple <apopple@...dia.com>,
        Peter Xu <peterx@...hat.com>,
        Ralph Campbell <rcampbell@...dia.com>,
        Naoya Horiguchi <naoya.horiguchi@....com>,
        linux-kernel@...r.kernel.org,
        Hongchen Zhang <zhanghongchen@...ngson.cn>
Subject: [PATCH] mm/swapops: make is_pmd_migration_entry more strict

a pmd migration entry should first be a swap pmd,so
use is_swap_pmd(pmd) instead of !pmd_present(pmd).

On the other hand, some architecture (MIPS for example)
may misjudge a pmd_none entry as a pmd migration entry.

Signed-off-by: Hongchen Zhang <zhanghongchen@...ngson.cn>
---
 include/linux/swapops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index d356ab4..1d16569 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -304,7 +304,7 @@ static inline pmd_t swp_entry_to_pmd(swp_entry_t entry)
 
 static inline int is_pmd_migration_entry(pmd_t pmd)
 {
-	return !pmd_present(pmd) && is_migration_entry(pmd_to_swp_entry(pmd));
+	return is_swap_pmd(pmd) && is_migration_entry(pmd_to_swp_entry(pmd));
 }
 #else
 static inline void set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw,
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ