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: <6f3d7b9e-f635-befb-0fa8-74ceaaa1dea0@suse.com>
Date:   Mon, 17 Sep 2018 09:48:05 +0200
From:   Juergen Gross <jgross@...e.com>
To:     Feng Tang <feng.tang@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...e.hu>,
        H Peter Anvin <hpa@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Michal Hocko <mhocko@...nel.org>, x86@...nel.org,
        linux-kernel@...r.kernel.org, Yinghai Lu <yinghai@...nel.org>,
        Dave Hansen <dave.hansen@...el.com>,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] x86/mm: Expand static page table for fixmap space

On 17/09/18 09:34, Feng Tang wrote:
> We met a kernel panic when enabling earlycon, which is due to
> the fixmap address of earlycon is not statically setup.
> 
> Currently the static fixmap setup in head_64.S only covers 2M
> virtual address space, while it acutually could be in 4M space
> with different kernel configurations.
> 
> So increase the static space to 4M for now by defining FIXMAP_PMD_NUM
> to 2, and add a build time check for future possible overflow so that
> the macro could be increased accordingly.
> 
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Feng Tang <feng.tang@...el.com>
> ---
>  arch/x86/include/asm/fixmap.h     |  3 +++
>  arch/x86/include/asm/pgtable_64.h |  3 ++-
>  arch/x86/kernel/head_64.S         | 16 ++++++++++++----
>  arch/x86/mm/pgtable.c             | 10 ++++++++++
>  arch/x86/xen/mmu_pv.c             |  4 +++-
>  5 files changed, 30 insertions(+), 6 deletions(-)
> 

...

> diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
> index 2fe5c9b..19077f9 100644
> --- a/arch/x86/xen/mmu_pv.c
> +++ b/arch/x86/xen/mmu_pv.c
> @@ -1952,7 +1952,9 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
>  	set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO);
>  	set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
>  	set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
> -	set_page_prot(level1_fixmap_pgt, PAGE_KERNEL_RO);
> +
> +	for (i = 0; i < FIXMAP_PMD_NUM; i++)
> +		set_page_prot(level1_fixmap_pgt + i * 512, PAGE_KERNEL_RO);

Please use PTRS_PER_PTE instead of the literal 512.

Some lines further up level1_fixmap_pgt is mentioned in a comment.
Please update that, too:

-	/* L3_k[511][506] -> level1_fixmap_pgt */
+	/* L3_k[511][506, ...] -> level1_fixmap_pgt */


Juergen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ