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] [day] [month] [year] [list]
Date:   Fri, 31 May 2019 13:53:05 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     Qian Cai <cai@....pw>, mingo@...hat.com, tglx@...utronix.de,
        bp@...en8.de
Cc:     dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
        hpa@...or.com, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/mm: fix an unused variable "tsk" warning

On 5/31/19 1:38 PM, Qian Cai wrote:
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -1015,7 +1015,9 @@ static inline bool bad_area_access_from_pkeys(unsigned long error_code,
>  do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
>  	  vm_fault_t fault)
>  {
> +#ifdef CONFIG_MEMORY_FAILURE
>  	struct task_struct *tsk = current;
> +#endif
>  
>  	/* Kernel mode? Handle exceptions or die: */
>  	if (!(error_code & X86_PF_USER)) {

Ick.  I'd much rather see this:

#ifdef CONFIG_MEMORY_FAILURE
        if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
                unsigned lsb = 0;

become:

        if (IS_ENABLED(CONFIG_MEMORY_FAILURE) &&
 	    (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE))) {
                unsigned lsb = 0;

than add another #ifdef.

BTW, which tree are you doing this against?  Current -linus uses tsk in
the last line of do_sigbus():

        force_sig_fault(SIGBUS, BUS_ADRERR, ..., tsk);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ