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:	Thu, 17 Jan 2008 14:56:18 +0100
From:	Jan Kiszka <jan.kiszka@...mens.com>
To:	Jason Wessel <jason.wessel@...driver.com>
CC:	linux-kernel@...r.kernel.org, rusty@...tcorp.com.au
Subject: Re: [PATCH 16/21] KGDB: This allows for KGDB to better deal with
 autoloaded   modules.

Jason Wessel wrote:
> Signed-off-by: Jason Wessel <jason.wessel@...driver.com>
> 
...
> --- linux-2.6-kgdb.orig/kernel/module.c
> +++ linux-2.6-kgdb/kernel/module.c
> @@ -65,6 +65,7 @@ extern int module_sysfs_initialized;
>   * (add/delete uses stop_machine). */
>  static DEFINE_MUTEX(module_mutex);
>  static LIST_HEAD(modules);
> +static DECLARE_MUTEX(notify_mutex);

These days, notify_mutex should better be a real mutex.

Signed-off-by: Jan Kiszka <jan.kiszka@...mens.com>

---
 kernel/module.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Index: b/kernel/module.c
===================================================================
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -66,7 +66,7 @@ extern int module_sysfs_initialized;
  * (add/delete uses stop_machine). */
 static DEFINE_MUTEX(module_mutex);
 static LIST_HEAD(modules);
-static DECLARE_MUTEX(notify_mutex);
+static DEFINE_MUTEX(notify_mutex);
 
 static BLOCKING_NOTIFIER_HEAD(module_notify_list);
 
@@ -712,10 +712,10 @@ sys_delete_module(const char __user *nam
 	if (ret != 0)
 		goto out;
 
-	down(&notify_mutex);
+	mutex_lock(&notify_mutex);
 	blocking_notifier_call_chain(&module_notify_list, MODULE_STATE_GOING,
 								 mod);
-	up(&notify_mutex);
+	mutex_unlock(&notify_mutex);
 
 
 	/* Never wait if forced. */
@@ -730,10 +730,10 @@ sys_delete_module(const char __user *nam
 	}
 	free_module(mod);
 
-	down(&notify_mutex);
+	mutex_lock(&notify_mutex);
 	blocking_notifier_call_chain(&module_notify_list, MODULE_STATE_GONE,
 			NULL);
-	up(&notify_mutex);
+	mutex_unlock(&notify_mutex);
 
  out:
 	mutex_unlock(&module_mutex);
@@ -2182,11 +2182,11 @@ sys_init_module(void __user *umod,
 		/* Init routine failed: abort.  Try to protect us from
                    buggy refcounters. */
 		mod->state = MODULE_STATE_GOING;
-		down(&notify_mutex);
+		mutex_lock(&notify_mutex);
 		blocking_notifier_call_chain(&module_notify_list,
 				MODULE_STATE_GOING,
 				mod);
-		up(&notify_mutex);
+		mutex_unlock(&notify_mutex);
 		synchronize_sched();
 		module_put(mod);
 		mutex_lock(&module_mutex);
--
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