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]
Message-ID: <0dfcaae1-9ee7-47c5-b530-2062021155f0@amd.com>
Date: Mon, 1 Jul 2024 13:59:15 -0500
From: "Kalra, Ashish" <ashish.kalra@....com>
To: Jürgen Groß <jgross@...e.com>,
 dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
 tglx@...utronix.de, mingo@...hat.com, bp@...en8.de
Cc: x86@...nel.org, hpa@...or.com, kirill.shutemov@...ux.intel.com,
 rick.p.edgecombe@...el.com, mhklinux@...look.com, peterx@...hat.com,
 linux-kernel@...r.kernel.org, thomas.lendacky@....com,
 linux-coco@...ts.linux.dev, jroedel@...e.de
Subject: Re: [PATCH] x86/mm: fix lookup_address() to handle physical memory
 holes in direct mapping


On 7/1/2024 1:38 PM, Jürgen Groß wrote:
> On 01.07.24 19:57, Kalra, Ashish wrote:
>>
>> On 6/29/2024 5:20 AM, Jürgen Groß wrote:
>>> On 28.06.24 22:52, Ashish Kalra wrote:
>>>> From: Ashish Kalra <ashish.kalra@....com>
>>>>
>>>> lookup_address_in_pgd_attr() at pte level it is simply returning
>>>> pte_offset_kernel() and there does not seem to be a check for
>>>> returning NULL if pte_none().
>>>>
>>>> Fix lookup_address_in_pgd_attr() to add check for pte_none()
>>>> after pte_offset_kernel() and return NULL if it is true.
>>>
>>> Please have a look at the comment above lookup_address(). You should not
>>> break the documented behavior without verifying that no caller is relying
>>> on the current behavior. If this is fine, please update the comment.
>>>
>>>
>> I don't get that, in this case the PTE does not exist, so as per the comments here lookup_address() should have returned NULL.
>
> There is a PTE, but it is all 0.
>
> There is no _valid_ PTE. No PTE would mean that the related PMD entry (or any
> other higher level entry) is invalid.

Then what is the caller supposed to do in this case ?

As the return from lookup_address() is non-NULL in this case, accessing it causes a fatal #PF.

Is the caller supposed to add the check for a valid PTE using pte_none(*pte) ?

Thanks, Ashish

>
> Remember that the W^X checking needs to be performed _before_ a new PTE is
> written.
>
>
> Juergen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ