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:   Mon, 8 May 2023 14:23:11 +0200
From:   Juergen Gross <jgross@...e.com>
To:     linux-kernel@...r.kernel.org, x86@...nel.org
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] x86/mm: fix __swp_entry_to_pte() for Xen PV guests

PING (3rd one, after 2 months of getting no feedback)!

I'm inclined to carry it just via the Xen tree if x86 maintainers continue
to ignore it ...


Juergen

On 06.03.23 13:32, Juergen Gross wrote:
> Normally __swp_entry_to_pte() is never called with a value translating
> to a valid PTE. The only known exception is pte_swap_tests(), resulting
> in a WARN splat in Xen PV guests, as __pte_to_swp_entry() did
> translate the PFN of the valid PTE to a guest local PFN, while
> __swp_entry_to_pte() doesn't do the opposite translation.
> 
> Fix that by using __pte() in __swp_entry_to_pte() instead of open
> coding the native variant of it.
> 
> For correctness do the similar conversion for __swp_entry_to_pmd().
> 
> Fixes: 05289402d717 ("mm/debug_vm_pgtable: add tests validating arch helpers for core MM features")
> Signed-off-by: Juergen Gross <jgross@...e.com>
> ---
>   arch/x86/include/asm/pgtable_64.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
> index 7929327abe00..a629b1b9f65a 100644
> --- a/arch/x86/include/asm/pgtable_64.h
> +++ b/arch/x86/include/asm/pgtable_64.h
> @@ -237,8 +237,8 @@ static inline void native_pgd_clear(pgd_t *pgd)
>   
>   #define __pte_to_swp_entry(pte)		((swp_entry_t) { pte_val((pte)) })
>   #define __pmd_to_swp_entry(pmd)		((swp_entry_t) { pmd_val((pmd)) })
> -#define __swp_entry_to_pte(x)		((pte_t) { .pte = (x).val })
> -#define __swp_entry_to_pmd(x)		((pmd_t) { .pmd = (x).val })
> +#define __swp_entry_to_pte(x)		(__pte((x).val))
> +#define __swp_entry_to_pmd(x)		(__pmd((x).val))
>   
>   extern void cleanup_highmap(void);
>   


Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ