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>] [day] [month] [year] [list]
Date:   Fri,  3 Nov 2017 13:47:53 +0000
From:   Julien Thierry <julien.thierry@....com>
To:     linux-kernel@...r.kernel.org
Cc:     Julien Thierry <julien.thierry@....com>
Subject: [PATCH] lib/bug: Fix build error

Generic bug management code handle a table of bugs per module. When kernel
is built without CONFIG_MODULES, the module_bug_list is compiled out, yet
generic_bug_clear_once tries to reference it, causing an error.

Introduce helper function to avoid the reference to module_bug_list when it
is not defined.

Signed-off-by: Julien Thierry <julien.thierry@....com>
Cc: linux-kernel@...r.kernel.org
---
 lib/bug.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/lib/bug.c b/lib/bug.c
index fa9c901..54c1a9b 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -50,6 +50,8 @@

 extern struct bug_entry __start___bug_table[], __stop___bug_table[];

+static void clear_once_table(struct bug_entry *start, struct bug_entry *end);
+
 static inline unsigned long bug_addr(const struct bug_entry *bug)
 {
 #ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
@@ -121,8 +123,23 @@ void module_bug_cleanup(struct module *mod)
 	list_del_rcu(&mod->bug_list);
 }

+static void module_bug_clear_once(void)
+{
+	struct module *mod;
+
+	rcu_read_lock_sched();
+	list_for_each_entry_rcu(mod, &module_bug_list, bug_list)
+		clear_once_table(mod->bug_table,
+				 mod->bug_table + mod->num_bugs);
+	rcu_read_unlock_sched();
+}
+
 #else

+static inline void module_bug_clear_once(void)
+{
+}
+
 static inline struct bug_entry *module_find_bug(unsigned long bugaddr)
 {
 	return NULL;
@@ -207,13 +224,6 @@ static void clear_once_table(struct bug_entry *start, struct bug_entry *end)

 void generic_bug_clear_once(void)
 {
-	struct module *mod;
-
-	rcu_read_lock_sched();
-	list_for_each_entry_rcu(mod, &module_bug_list, bug_list)
-		clear_once_table(mod->bug_table,
-				 mod->bug_table + mod->num_bugs);
-	rcu_read_unlock_sched();
-
+	module_bug_clear_once();
 	clear_once_table(__start___bug_table, __stop___bug_table);
 }
--
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ