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: <20150212154232.GE18363@lerouge>
Date:	Thu, 12 Feb 2015 16:42:34 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Rik van Riel <riel@...hat.com>
Cc:	paulmck@...ux.vnet.ibm.com, luto@...capital.net,
	will.deacon@....com, linux-kernel@...r.kernel.org,
	kvm@...r.kernel.org, mtosatti@...hat.com, borntraeger@...ibm.com,
	lcapitulino@...hat.com, pbonzini@...hat.com
Subject: Re: [PATCH -v5 6/5] context_tracking: fix exception_enter when
 already in IN_KERNEL

On Wed, Feb 11, 2015 at 02:43:19PM -0500, Rik van Riel wrote:
> If exception_enter happens when already in IN_KERNEL state, the
> code still calls context_tracking_exit, which ends up in
> rcu_eqs_exit_common, which explodes with a WARN_ON when it is
> called in a situation where dynticks are not enabled.

Fortunately context_tracking_exit() already has a current_state == IN_KERNEL
check so this shouldn't be a problem.

Meanwhile I'll still take the patch, it's better to handle that
from the caller.

Thanks.

> 
> This can be avoided by having exception_enter only switch to
> IN_KERNEL state if the current state is not already IN_KERNEL.
> 
> Signed-off-by: Rik van Riel <riel@...hat.com>
> Reported-by: Luiz Capitulino <lcapitulino@...hat.com>
> ---
> Frederic, you will want this "bonus" patch, too :)
> 
> Thanks to Luiz for finding this one. Whatever I was running did not
> trigger this issue...
> 
>  include/linux/context_tracking.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
> index b65fd1420e53..9da230406e8c 100644
> --- a/include/linux/context_tracking.h
> +++ b/include/linux/context_tracking.h
> @@ -37,7 +37,8 @@ static inline enum ctx_state exception_enter(void)
>  		return 0;
>  
>  	prev_ctx = this_cpu_read(context_tracking.state);
> -	context_tracking_exit(prev_ctx);
> +	if (prev_ctx != IN_KERNEL)
> +		context_tracking_exit(prev_ctx);
>  
>  	return prev_ctx;
>  }
> 
--
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