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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 06 Sep 2012 11:54:47 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Robert Richter <robert.richter@....com>
Cc:	wyang1 <Wei.Yang@...driver.com>, Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, oprofile-list@...ts.sourceforge.net
Subject: Re: [PATCH] x86, 32-bit: Fix invalid stack address while in softirq

On Thu, 2012-09-06 at 17:36 +0200, Robert Richter wrote:

> I meant:
> 
> unsigned long kernel_stack_pointer(struct pt_regs *regs)
> {
> 	unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1);
> 	unsigned long sp = (unsigned long)&regs->sp;
> 	struct thread_info *tinfo;
> 
> 	if (context == (sp & ~(THREAD_SIZE - 1)))
> 		return sp;
> 	
> 	tinfo = (struct thread_info *)context;
> 	if (tinfo->previous_esp)
> 		return tinfo->previous_esp;
> 
> 	return (unsigned long)regs;
> }
> 
> -Robert
> 
> > 
> > Maybe this is even better.
> > 
> >

Yeah, this is probably the safest.

Thanks,

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ