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: <4F211126.1090204@hitachi.com>
Date:	Thu, 26 Jan 2012 17:39:02 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org,
	linux-rt-users <linux-rt-users@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Carsten Emde <C.Emde@...dl.org>,
	John Kacur <jkacur@...hat.com>, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Alexander van Heukelum <heukelum@...tmail.fm>,
	Andi Kleen <ak@...ux.intel.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Clark Williams <williams@...hat.com>,
	Luis Goncalves <lgoncalv@...hat.com>
Subject: Re: [PATCH RT 1/2 v2] x86: Do not disable preemption in int3 on
 32bit

(2012/01/25 23:32), Steven Rostedt wrote:
> Preemption must be disabled before enabling interrupts in do_trap
> on x86_64 because the stack in use for int3 and debug is a per CPU
> stack set by th IST. But in 32bit, the stack still belongs to the
> current task and there is no problem in scheduling out the task.
> 
> Keep preemption enabled on X86_32 when enabling interrupts for
> do_trap().
> 
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>

Hmm, I think you'd better change caller side, because the
function itself has "preempt" in its name. I think it can
easily mislead other people.

Thank you,

> 
> Index: linux-rt.git/arch/x86/kernel/traps.c
> ===================================================================
> --- linux-rt.git.orig/arch/x86/kernel/traps.c
> +++ linux-rt.git/arch/x86/kernel/traps.c
> @@ -89,7 +89,14 @@ static inline void conditional_sti(struc
>  
>  static inline void preempt_conditional_sti(struct pt_regs *regs)
>  {
> +#ifdef CONFIG_X86_64
> +	/*
> +	 * X86_64 uses a per CPU stack for certain traps like int3.
> +	 * We must disable preemption, otherwise we can corrupt the
> +	 * stack if the task is scheduled out with this stack.
> +	 */
>  	inc_preempt_count();
> +#endif
>  	if (regs->flags & X86_EFLAGS_IF)
>  		local_irq_enable();
>  }
> @@ -104,7 +111,9 @@ static inline void preempt_conditional_c
>  {
>  	if (regs->flags & X86_EFLAGS_IF)
>  		local_irq_disable();
> +#ifdef CONFIG_X86_64
>  	dec_preempt_count();
> +#endif
>  }
>  
>  static void __kprobes
> 

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
--
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