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, 10 May 2007 09:12:41 -0400
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Alexey Dobriyan <adobriyan@...il.com>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	hch@...radead.org, Adrian Bunk <bunk@...sta.de>
Subject: Re: [patch 02/10] Linux Kernel Markers, architecture independent code.

Linux Kernel Markers - Architecture Independant Code fix 2

Fix trivial SMP bug in list_modules.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
---
 kernel/module.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6-lttng/kernel/module.c
===================================================================
--- linux-2.6-lttng.orig/kernel/module.c	2007-05-10 08:51:02.000000000 -0400
+++ linux-2.6-lttng/kernel/module.c	2007-05-10 08:51:06.000000000 -0400
@@ -2657,13 +2657,16 @@
 	/* Enumerate loaded modules */
 	struct list_head	*i;
 	struct module		*mod;
-	unsigned long refcount = 0;
+	unsigned long refcount;
+	int cpu;
 
 	mutex_lock(&module_mutex);
 	list_for_each(i, &modules) {
 		mod = list_entry(i, struct module, list);
+		refcount = 0;
 #ifdef CONFIG_MODULE_UNLOAD
-		refcount = local_read(&mod->ref[0].count);
+		for_each_online_cpu(cpu)
+			refcount += local_read(&mod->ref[cpu].count);
 #endif //CONFIG_MODULE_UNLOAD
 		trace_mark(list_module, "%s %d %lu",
 				mod->name, mod->state, refcount);

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
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