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:	Fri, 25 Sep 2009 11:48:55 +0200
From:	Borislav Petkov <borislav.petkov@....com>
To:	Mauro Carvalho Chehab <mchehab@...hat.com>
CC:	bluesmoke-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH 17/63] edac_mce: Add an interface driver to report mce
 errors via edac

Mauro,

On Thu, Sep 24, 2009 at 07:27:27PM -0300, Mauro Carvalho Chehab wrote:
> edac_mce module is an interface module that gets mcelog data and
> forwards to any registered edac module that expects to receive data via
> mce.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@...hat.com>
> ---
>  arch/x86/kernel/cpu/mcheck/mce.c |   12 ++++++++
>  drivers/edac/Kconfig             |    8 ++++-
>  drivers/edac/Makefile            |    3 +-
>  drivers/edac/edac_mce.c          |   58 ++++++++++++++++++++++++++++++++++++++
>  include/linux/edac_mce.h         |   31 ++++++++++++++++++++
>  5 files changed, 110 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/edac/edac_mce.c
>  create mode 100644 include/linux/edac_mce.h
> 
> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> index 2f5aab2..fefbb7c 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -35,6 +35,7 @@
>  #include <linux/fs.h>
>  #include <linux/mm.h>
>  #include <linux/debugfs.h>
> +#include <linux/edac_mce.h>
>  
>  #include <asm/processor.h>
>  #include <asm/hw_irq.h>
> @@ -135,6 +136,15 @@ void mce_log(struct mce *mce)
>  		entry = rcu_dereference(mcelog.next);
>  		for (;;) {
>  			/*
> +			 * If edac_mce is enabled, it will check the error type
> +			 * and will process it, if it is a known error.
> +			 * Otherwise, the error will be sent through mcelog
> +			 * interface
> +			 */
> +			if (edac_mce_parse(mce))
> +				return;

for the third time (!): this may run in NMI context and as such does not
obey to normal kernel locking rules and you cannot safely use almost any
kernel resources involving locking. This way, your hook calls into a
module, which is a very bad idea. Please remove that hook and put in the
polling routine or somewhere more appropriate.

> +
> +			/*
>  			 * When the buffer fills up discard new entries.
>  			 * Assume that the earlier errors are the more
>  			 * interesting ones:
> @@ -193,6 +203,8 @@ static void print_mce(struct mce *m)
>  			m->cpuvendor, m->cpuid, m->time, m->socketid,
>  			m->apicid);
>  
> +	edac_mce_parse(m);
> +
>  	decode_mce(m);
>  }

-- 
Regards/Gruss,
Boris.

Operating | Advanced Micro Devices GmbH
  System  | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. München, Germany
 Research | Geschäftsführer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
  Center  | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
  (OSRC)  | Registergericht München, HRB Nr. 43632

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