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: <20201005163309.GF21151@zn.tnic>
Date:   Mon, 5 Oct 2020 18:33:09 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Tony Luck <tony.luck@...el.com>
Cc:     Youquan Song <youquan.song@...el.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/7] x86/mce: Change fault_in_kernel_space() from
 static to global

On Wed, Sep 30, 2020 at 04:26:09PM -0700, Tony Luck wrote:
> From: Youquan Song <youquan.song@...el.com>
> 
> Machine check code needs to be able to determine if a faulting address
> is in user or kernel space. There is already a function to do this.
> 
> Change from "static int" to "bool" and add declaration to <asm/traps.h>
> 
> No functional change.
> 
> Signed-off-by: Youquan Song <youquan.song@...el.com>
> Signed-off-by: <tony.luck@...el.com>
> ---
>  arch/x86/include/asm/traps.h | 2 ++
>  arch/x86/mm/fault.c          | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
> index 714b1a30e7b0..df0b7bfc1234 100644
> --- a/arch/x86/include/asm/traps.h
> +++ b/arch/x86/include/asm/traps.h
> @@ -35,6 +35,8 @@ extern int panic_on_unrecovered_nmi;
>  
>  void math_emulate(struct math_emu_info *);
>  
> +bool fault_in_kernel_space(unsigned long address);
> +
>  #ifdef CONFIG_VMAP_STACK
>  void __noreturn handle_stack_overflow(const char *message,
>  				      struct pt_regs *regs,
> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> index 35f1498e9832..88ae443e4e5f 100644
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -1081,7 +1081,7 @@ access_error(unsigned long error_code, struct vm_area_struct *vma)
>  	return 0;
>  }
>  
> -static int fault_in_kernel_space(unsigned long address)
> +bool fault_in_kernel_space(unsigned long address)
>  {
>  	/*
>  	 * On 64-bit systems, the vsyscall page is at an address above
> -- 

Yeah, merge this one into the last patch where this function is used.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ