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:	Wed, 29 Apr 2009 11:39:53 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Stuart Bennett <stuart@...edesktop.org>
Cc:	Steven Rostedt <rostedt@...dmis.org>, Pekka Paalanen <pq@....fi>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86 mmiotrace: only register for die notifier when
	tracer active


* Stuart Bennett <stuart@...edesktop.org> wrote:

> Follow up to afcfe024aebd74b0984a41af9a34e009cf5badaf in Linus' tree
> ("x86: mmiotrace: quieten spurious warning message")
> 
> Signed-off-by: Stuart Bennett <stuart@...edesktop.org>
> Acked-by: Pekka Paalanen <pq@....fi>
> ---
>  arch/x86/mm/kmmio.c       |   21 ++++++++++++++++++---
>  arch/x86/mm/mmio-mod.c    |    2 ++
>  include/linux/mmiotrace.h |    2 ++
>  3 files changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
> index 422f49e..bdbbf0d 100644
> --- a/arch/x86/mm/kmmio.c
> +++ b/arch/x86/mm/kmmio.c
> @@ -311,7 +311,12 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs)
>  	struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx);
>  
>  	if (!ctx->active) {
> -		pr_debug("kmmio: spurious debug trap on CPU %d.\n",
> +		/*
> +		 * debug traps without an active context are due to either
> +		 * something external causing them (f.e. using a debugger while
> +		 * mmio tracing enabled), or erroneous behaviour
> +		 */
> +		pr_warning("kmmio: unexpected debug trap on CPU %d.\n",
>  							smp_processor_id());
>  		goto out;
>  	}
> @@ -545,11 +550,21 @@ static struct notifier_block nb_die = {
>  	.notifier_call = kmmio_die_notifier
>  };
>  
> -static int __init init_kmmio(void)
> +int kmmio_init(void)
>  {
>  	int i;
>  	for (i = 0; i < KMMIO_PAGE_TABLE_SIZE; i++)
>  		INIT_LIST_HEAD(&kmmio_page_table[i]);
>  	return register_die_notifier(&nb_die);
>  }
> -fs_initcall(init_kmmio); /* should be before device_initcall() */
> +
> +void kmmio_cleanup(void)
> +{
> +	int i;
> +
> +	unregister_die_notifier(&nb_die);
> +	for (i = 0; i < KMMIO_PAGE_TABLE_SIZE; i++)
> +		WARN_ONCE(!list_empty(&kmmio_page_table[i]),
> +			  KERN_ERR "kmmio_page_table not empty at cleanup, "
> +				   "any further tracing will leak memory\n");
> +}

Note, i cleaned this up a bit in the commit i applied - we rather 
let strings become over-long than break them in the middle

	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