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:   Thu, 6 Sep 2018 15:32:00 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Andy Lutomirski <luto@...nel.org>
cc:     x86@...nel.org, Borislav Petkov <bp@...en8.de>,
        LKML <linux-kernel@...r.kernel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH] x86/fault: Decode page fault OOPSes better

On Fri, 31 Aug 2018, Andy Lutomirski wrote:
> @@ -671,6 +705,48 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,
>  		 address < PAGE_SIZE ? "NULL pointer dereference" : "paging request",
>  		 (void *)address);
>  
> +	errcode[0] = 0;

error_code vs. errcode ? errtxt perhaps?

> +#define ERRSTR(x) if (error_code & X86_PF_##x) strcat(errcode, " " #x)
> +	ERRSTR(PROT);
> +	ERRSTR(WRITE);
> +	ERRSTR(USER);
> +	ERRSTR(RSVD);
> +	ERRSTR(INSTR);
> +	ERRSTR(PK);
> +#undef ERRSTR

Eeew. That's too ugly to live.

static inline errstr(unsigned long ec, char *buf, unsigned long mask,
       	      	     const char *txt)
{
	....
}

and then

	errstr(error_code, errtxt, X86_PF_PROT, "PROT");

Yes, it's slightly more to type but this macro mess in the middle of the
code just makes my eyes bleed.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ