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]
Message-Id: <1437368221-46374-1-git-send-email-mnfhuang@gmail.com>
Date:	Mon, 20 Jul 2015 12:57:01 +0800
From:	Minfei Huang <mnfhuang@...il.com>
To:	akpm@...ux-foundation.org, fengguang.wu@...el.com
Cc:	linux-kernel@...r.kernel.org, Minfei Huang <mnfhuang@...il.com>
Subject: [PATCH] Fix compiling error once merge define-kallsyms_cmp_symbol_t-as-function-type-to-simplify-the-code

Code will fail to be compiled, once it is merged the patch
5ed0a999616a050af1268a99cc442fd0824a2b07(Define kallsyms_cmp_symbol_t
as function type to simplify the code).

The root cause which fails to compile is I included the linux/module.h
head file to linux/kallsyms.h. Now I write the patch to fix this issue,
and it passes on platform s390, x86_64, i386, etc..

    In file included from arch/s390/include/asm/elf.h:130:0,
                     from include/linux/elf.h:4,
                     from include/linux/module.h:14,
                     from include/linux/kallsyms.h:11,
                     from kernel/sched/auto_group.c:5:
 >> arch/s390/include/asm/mmu_context.h:80:0: warning: "finish_arch_post_lock_switch" redefined
     #define finish_arch_post_lock_switch finish_arch_post_lock_switch
     ^
    In file included from kernel/sched/auto_group.c:1:0:
    kernel/sched/sched.h:1072:0: note: this is the location of the previous definition
     # define finish_arch_post_lock_switch() do { } while (0)
     ^

Signed-off-by: Minfei Huang <mnfhuang@...il.com>
---
 include/linux/kallsyms.h | 4 +++-
 include/linux/module.h   | 4 +---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index e8ed37d..d48bfa3 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -8,7 +8,6 @@
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
-#include <linux/module.h>
 
 #define KSYM_NAME_LEN 128
 #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
@@ -16,6 +15,9 @@
 
 struct module;
 
+typedef int (*kallsyms_cmp_symbol_t)(void *, const char *,
+		struct module *, unsigned long);
+
 #ifdef CONFIG_KALLSYMS
 /* Lookup the address for a symbol. Returns 0 if not found. */
 unsigned long kallsyms_lookup_name(const char *name);
diff --git a/include/linux/module.h b/include/linux/module.h
index 848f084..6015912 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -22,6 +22,7 @@
 
 #include <linux/percpu.h>
 #include <asm/module.h>
+#include <linux/kallsyms.h>
 
 /* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
 #define MODULE_SIG_STRING "~Module signature appended~\n"
@@ -273,9 +274,6 @@ const struct exception_table_entry *search_exception_tables(unsigned long add);
 
 struct notifier_block;
 
-typedef int (*kallsyms_cmp_symbol_t)(void *, const char *,
-		struct module *, unsigned long);
-
 #ifdef CONFIG_MODULES
 
 extern int modules_disabled; /* for sysctl */
-- 
2.2.2

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