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: <B04B2A1C-8FB7-4D8F-A67E-1666B6DA4E14@zytor.com>
Date: Wed, 17 Apr 2024 07:43:40 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Hou Wenlong <houwenlong.hwl@...group.com>, linux-kernel@...r.kernel.org
CC: Xin Li <xin@...or.com>, Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
        Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org
Subject: Re: [PATCH] x86/fred: Fix incorrect error code printout in fred_bad_type()

On April 17, 2024 4:34:25 AM PDT, Hou Wenlong <houwenlong.hwl@...group.com> wrote:
>The 'regs->orig_ax' has been invalidated to '-1' in the entry, so in the
>printout, fred_bad_type() should use the passed parameter 'error_code'.
>
>Fixes: 14619d912b65 ("x86/fred: FRED entry/exit and dispatch code")
>Signed-off-by: Hou Wenlong <houwenlong.hwl@...group.com>
>---
> arch/x86/entry/entry_fred.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/arch/x86/entry/entry_fred.c b/arch/x86/entry/entry_fred.c
>index ac120cbdaaf2..099697ba6e58 100644
>--- a/arch/x86/entry/entry_fred.c
>+++ b/arch/x86/entry/entry_fred.c
>@@ -28,9 +28,9 @@ static noinstr void fred_bad_type(struct pt_regs *regs, unsigned long error_code
> 	if (regs->fred_cs.sl > 0) {
> 		pr_emerg("PANIC: invalid or fatal FRED event; event type %u "
> 			 "vector %u error 0x%lx aux 0x%lx at %04x:%016lx\n",
>-			 regs->fred_ss.type, regs->fred_ss.vector, regs->orig_ax,
>+			 regs->fred_ss.type, regs->fred_ss.vector, error_code,
> 			 fred_event_data(regs), regs->cs, regs->ip);
>-		die("invalid or fatal FRED event", regs, regs->orig_ax);
>+		die("invalid or fatal FRED event", regs, error_code);
> 		panic("invalid or fatal FRED event");
> 	} else {
> 		unsigned long flags = oops_begin();
>@@ -38,10 +38,10 @@ static noinstr void fred_bad_type(struct pt_regs *regs, unsigned long error_code
> 
> 		pr_alert("BUG: invalid or fatal FRED event; event type %u "
> 			 "vector %u error 0x%lx aux 0x%lx at %04x:%016lx\n",
>-			 regs->fred_ss.type, regs->fred_ss.vector, regs->orig_ax,
>+			 regs->fred_ss.type, regs->fred_ss.vector, error_code,
> 			 fred_event_data(regs), regs->cs, regs->ip);
> 
>-		if (__die("Invalid or fatal FRED event", regs, regs->orig_ax))
>+		if (__die("Invalid or fatal FRED event", regs, error_code))
> 			sig = 0;
> 
> 		oops_end(flags, regs, sig);

Acked-by: H. Peter Anvin (Intel) <hpa@...or.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ