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: <20150507095832.GA7976@gmail.com>
Date:	Thu, 7 May 2015 11:58:32 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Mike Galbraith <umgwanakikbuti@...il.com>,
	Chris Metcalf <cmetcalf@...hip.com>,
	Dave Jones <davej@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Oleg Nesterov <oleg@...hat.com>,
	"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...hat.com>, Rik van Riel <riel@...hat.com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH 1/4] context_tracking: Protect against recursion


* Frederic Weisbecker <fweisbec@...il.com> wrote:

> @@ -75,6 +94,11 @@ void context_tracking_enter(enum ctx_state state)
>  	WARN_ON_ONCE(!current->mm);
>  
>  	local_irq_save(flags);
> +	if (!context_tracking_recursion_enter()) {
> +		local_irq_restore(flags);
> +		return;
> +	}
> +
>  	if ( __this_cpu_read(context_tracking.state) != state) {
>  		if (__this_cpu_read(context_tracking.active)) {
>  			/*
> @@ -105,6 +129,7 @@ void context_tracking_enter(enum ctx_state state)
>  		 */
>  		__this_cpu_write(context_tracking.state, state);
>  	}
> +	context_tracking_recursion_exit();

>  	local_irq_restore(flags);
>  }

So why not add an 'out_irq_restore:' label and use goto instead of 
duplicating the return path in the recursion check?

>  NOKPROBE_SYMBOL(context_tracking_enter);
> @@ -139,6 +164,10 @@ void context_tracking_exit(enum ctx_state state)
>  		return;
>  
>  	local_irq_save(flags);
> +	if (!context_tracking_recursion_enter()) {
> +		local_irq_restore(flags);
> +		return;

Ditto.

No need to resend, I fixed this up in the patch.

Thanks,

	Ingo
--
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