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] [day] [month] [year] [list]
Message-ID: <20240705071246.wzl224vveysrunzc@master>
Date: Fri, 5 Jul 2024 07:12:46 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: Wei Yang <richard.weiyang@...il.com>
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
	dave.hansen@...ux.intel.com, x86@...nel.org,
	linux-kernel@...r.kernel.org,
	"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
	Ingo Molnar <mingo@...nel.org>, Steve Wahl <steve.wahl@....com>
Subject: Re: [Patch v3] x86/head/64: remove redundant check on
 level2_kernel_pgt's _PAGE_PRESENT bit

May I ask what else I should do?

On Thu, May 23, 2024 at 12:35:39PM +0000, Wei Yang wrote:
>Remove a redundant check on kernel code's PMD _PAGE_PRESENT attribute
>before fix up.
>
>Current process looks like this:
>
>    pmd in [0, _text)
>        unset _PAGE_PRESENT
>    pmd in [_text, _end]
>        if (_PAGE_PRESENT)
>            fix up delta
>    pmd in (_end, 512)
>        unset _PAGE_PRESENT
>
>level2_kernel_pgt compiled with _PAGE_PRESENT set. The check is
>redundant
>
>Signed-off-by: Wei Yang <richard.weiyang@...il.com>
>CC: Thomas Gleixner <tglx@...utronix.de>
>CC: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
>CC: Ingo Molnar <mingo@...nel.org>
>CC: Steve Wahl <steve.wahl@....com>
>
>---
>v3: refine the change log per kirill's comment
>v2: adjust the change log to emphasize the redundant check
>---
> arch/x86/kernel/head64.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
>index a817ed0724d1..bac33ec19aa2 100644
>--- a/arch/x86/kernel/head64.c
>+++ b/arch/x86/kernel/head64.c
>@@ -260,8 +260,7 @@ unsigned long __head __startup_64(unsigned long physaddr,
> 
> 	/* fixup pages that are part of the kernel image */
> 	for (; i <= pmd_index((unsigned long)_end); i++)
>-		if (pmd[i] & _PAGE_PRESENT)
>-			pmd[i] += load_delta;
>+		pmd[i] += load_delta;
> 
> 	/* invalidate pages after the kernel image */
> 	for (; i < PTRS_PER_PMD; i++)
>-- 
>2.34.1

-- 
Wei Yang
Help you, Help me

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ