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: <1261652509.4937.185.camel@laptop>
Date:	Thu, 24 Dec 2009 12:01:49 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Jason Wessel <jason.wessel@...driver.com>
Cc:	linux-kernel@...r.kernel.org, kgdb-bugreport@...ts.sourceforge.net,
	kdb@....sgi.com, mingo@...e.hu, mort@....com,
	linux-arch@...r.kernel.org
Subject: Re: [PATCH 05/37] kdb: core for kgdb back end

Please use --no-chain-reply-to when posting patches using git, these inf
deep nested series are impossible to read.

On Wed, 2009-12-23 at 15:19 -0600, Jason Wessel wrote:
> diff --git a/kernel/module.c b/kernel/module.c
> index e96b8ed..25f6a7b 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -27,6 +27,7 @@
>  #include <linux/slab.h>
>  #include <linux/vmalloc.h>
>  #include <linux/elf.h>
> +#include <linux/kdb.h>
>  #include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
>  #include <linux/syscalls.h>
> @@ -79,6 +80,10 @@ EXPORT_TRACEPOINT_SYMBOL(module_get);
>  DEFINE_MUTEX(module_mutex);
>  EXPORT_SYMBOL_GPL(module_mutex);
>  static LIST_HEAD(modules);
> +#ifdef CONFIG_KGDB_KDB
> +struct list_head *kdb_modules = &modules; /* kdb needs the list of
> modules */
> +#endif /* CONFIG_KGDB_KDB */
> +
>  
>  /* Block module loading/unloading? */
>  int modules_disabled = 0;
> @@ -2654,8 +2659,14 @@ int module_get_kallsym(unsigned int symnum,
> unsigned long *value, char *type,
>                         char *name, char *module_name, int *exported)
>  {
>         struct module *mod;
> +#ifdef CONFIG_KGDB_KDB
> +       int get_lock = !KDB_IS_RUNNING();
> +#else
> +#define        get_lock 1
> +#endif
>  
> -       preempt_disable();
> +       if (get_lock)
> +               preempt_disable();
>         list_for_each_entry_rcu(mod, &modules, list) {
>                 if (symnum < mod->num_symtab) {
>                         *value = mod->symtab[symnum].st_value;
> @@ -2664,12 +2675,14 @@ int module_get_kallsym(unsigned int symnum,
> unsigned long *value, char *type,
>                                 KSYM_NAME_LEN);
>                         strlcpy(module_name, mod->name,
> MODULE_NAME_LEN);
>                         *exported = is_exported(name, *value, mod);
> -                       preempt_enable();
> +                       if (get_lock)
> +                               preempt_enable();
>                         return 0;
>                 }
>                 symnum -= mod->num_symtab;
>         }
> -       preempt_enable();
> +       if (get_lock)
> +               preempt_enable();
>         return -ERANGE;
>  }

Could you explain this?

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