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:   Mon, 27 Nov 2017 22:55:16 -0600
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Andy Lutomirski <luto@...capital.net>,
        Thomas Gleixner <tglx@...utronix.de>,
        "H . Peter Anvin" <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 02/21] x86/unwinder: Handle stack overflows more
 gracefully

On Mon, Nov 27, 2017 at 06:36:04PM +0100, Borislav Petkov wrote:
> > +static bool deref_stack_iret_regs(struct unwind_state *state, unsigned long addr,
> > +				  unsigned long *ip, unsigned long *sp)
> > +{
> > +	struct pt_regs *regs = (void *)addr - IRET_FRAME_OFFSET;
> 
> I guess those are traditionally done with container_of()...

Without modifying pt_regs, there's no container to speak of, but at
least IRET_FRAME_OFFSET uses offsetof(), which is similar.

> But yeah, FWIW, looks ok to me:
> 
> Reviewed-by: Borislav Petkov <bp@...e.de>

Thanks!


Ingo, can you fold in the below changes based on Boris' comments?


diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h
index 5be2fb23825a..c1688c2d0a12 100644
--- a/arch/x86/include/asm/unwind.h
+++ b/arch/x86/include/asm/unwind.h
@@ -57,7 +57,7 @@ void unwind_start(struct unwind_state *state, struct task_struct *task,
 #if defined(CONFIG_UNWINDER_ORC) || defined(CONFIG_UNWINDER_FRAME_POINTER)
 /*
  * WARNING: The entire pt_regs may not be safe to dereference.  In some cases,
- * only the iret registers are accessible.  Use with caution!
+ * only the iret frame registers are accessible.  Use with caution!
  */
 static inline struct pt_regs *unwind_get_entry_regs(struct unwind_state *state)
 {
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index fc918744ad7d..0bc95be5c638 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -66,7 +66,7 @@ static void show_regs_safe(struct stack_info *info, struct pt_regs *regs)
 		/*
 		 * When an interrupt or exception occurs in entry code, the
 		 * full pt_regs might not have been saved yet.  In that case
-		 * just print the iret return frame.
+		 * just print the iret frame.
 		 */
 		show_iret_regs(regs);
 	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ