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, 22 May 2024 22:33:20 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Wei Yang <richard.weiyang@...il.com>
Cc: Wei Yang <richard.weiyang@...il.com>, mingo@...hat.com, bp@...en8.de,
 dave.hansen@...ux.intel.com, x86@...nel.org, linux-kernel@...r.kernel.org,
 Vivek Goyal <vgoyal@...ibm.com>, "Kirill A . Shutemov"
 <kirill.shutemov@...ux.intel.com>, Ingo Molnar <mingo@...nel.org>, Steve
 Wahl <steve.wahl@....com>, Borislav Petkov <bp@...e.de>
Subject: Re: [PATCH] x86/head/64: level2_kernel_pgt's kernel area is built
 with _PAGE_PRESENT set

On Wed, May 22 2024 at 14:06, Wei Yang wrote:
> On Wed, May 22, 2024 at 11:58:01AM +0200, Thomas Gleixner wrote:
>>
>>What's the actual problem you are trying to solve?
>
> Not a problem. It tries to remove some duplicate check.

I assume you mean redundant check, right?

The changelog should explain that. I really could not figure out
what this is about.

>>>  	/* 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;
>>
>>Fixing up non-present PMDs is a pointless exercise.
>>
>
> Agree. While we are sure then range here must present.
>
> The whole process looks like this
>
>     pmd in [0, _text)
>         unset _PAGE_PRESENT
>     pmd in [_text, _end]
>         fix up delta
>     pmd in (_end, 256)
>         unset _PAGE_PRESENT
>
> Since we have compiled in _PAGE_PRESENT in this page table, it is not
> necessary to check _PAGE_PRESENT again before fixing up delta.

That wants to be in the change log.

Referencing the history of the code is definitely interesting and you
did a great job on decoding it, but for the change itself the only
relevant information is that all PMDs between _text and _end are marked
present because the whole table is marked so.

> BTW, if one entry between _text and _end is not present, we will failed to
> fixing the kernel code pmd entry, which will lead to some problem.

It does not because a non-present entry does not care about the load
delta obviously.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ