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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210513105234.GW1336@shell.armlinux.org.uk>
Date:   Thu, 13 May 2021 11:52:34 +0100
From:   Russell King - ARM Linux admin <linux@...linux.org.uk>
To:     Anshuman Khandual <anshuman.khandual@....com>
Cc:     linux-arm-kernel@...ts.infradead.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Allison Randal <allison@...utok.net>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm/mm: Drop [PTE|PMD]_TYPE_FAULT

On Thu, May 13, 2021 at 09:03:53AM +0100, Russell King - ARM Linux admin wrote:
> On Thu, May 13, 2021 at 11:21:53AM +0530, Anshuman Khandual wrote:
> > Drop these unused symbols i.e PTE_TYPE_FAULT and PMD_TYPE_FAULT.
> 
> They're documentation, although PTE_TYPE_FAULT ought to be used by
> __swp_entry() to show that better.

So really, we should be doing something like this:

diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index c02f24400369..c43e07d6046d 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -303,7 +303,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 #define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) })
 
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
-#define __swp_entry_to_pte(swp)	((pte_t) { (swp).val })
+#define __swp_entry_to_pte(swp)	__pte((swp).val | PTE_TYPE_FAULT)
 
 /*
  * It is an error for the kernel to have more swap files than we can

Since that is really what is going on here. It is by design that the
swp_entry_t is layed out to be correct, and of course because
PTE_TYPE_FAULT has the value of zero, the above merely adds to the
"documentation" rather than having any functional effect.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ