History

module: rename __kstrtab_ns_* to __kstrtabns_* to avoid symbol conflict

The module namespace produces __strtab_ns_<sym> symbols to store namespace strings, but it does not guarantee the name uniqueness. This is a potential problem because we have exported symbols starting with "ns_". For example, kernel/capability.c exports the following symbols: EXPORT_SYMBOL(ns_capable); EXPORT_SYMBOL(capable); Assume a situation where those are converted as follows: EXPORT_SYMBOL_NS(ns_capable, some_namespace); EXPORT_SYMBOL_NS(capable, some_namespace); The former expands to "__kstrtab_ns_capable" and "__kstrtab_ns_ns_capable", and the latter to "__kstrtab_capable" and "__kstrtab_ns_capable". Then, we have the duplicated "__kstrtab_ns_capable". To ensure the uniqueness, rename "__kstrtab_ns_*" to "__kstrtabns_*".

Masahiro Yamada committed 7 years ago

Commit fa6643c1 parent 389eb3f1 file · +3 −3Browse files

Unified · Split

include/linux/export.h+3−3
@@ -55,7 +55,7 @@ extern struct module __this_module; · 54 unmodified lines
5555 "__ksymtab_" #ns NS_SEPARATOR #sym ": \n" \
5656 " .long " #sym "- . \n" \
5757 " .long __kstrtab_" #sym "- . \n" \
58− " .long __kstrtab_ns_" #sym "- . \n" \
58+ " .long __kstrtabns_" #sym "- . \n" \
5959 " .previous \n")
6060
6161 #define __KSYMTAB_ENTRY(sym, sec) \
@@ -79,7 +79,7 @@ struct kernel_symbol { · 17 unmodified lines
7979 asm("__ksymtab_" #ns NS_SEPARATOR #sym) \
8080 __attribute__((section("___ksymtab" sec "+" #sym), used)) \
8181 __aligned(sizeof(void *)) \
82− = { (unsigned long)&sym, __kstrtab_##sym, __kstrtab_ns_##sym }
82+ = { (unsigned long)&sym, __kstrtab_##sym, __kstrtabns_##sym }
8383
8484 #define __KSYMTAB_ENTRY(sym, sec) \
8585 static const struct kernel_symbol __ksymtab_##sym \
@@ -112,7 +112,7 @@ struct kernel_symbol { · 26 unmodified lines
112112 /* For every exported symbol, place a struct in the __ksymtab section */
113113 #define ___EXPORT_SYMBOL_NS(sym, sec, ns) \
114114 ___export_symbol_common(sym, sec); \
115− static const char __kstrtab_ns_##sym[] \
115+ static const char __kstrtabns_##sym[] \
116116 __attribute__((section("__ksymtab_strings"), used, aligned(1))) \
117117 = #ns; \
118118 __KSYMTAB_ENTRY_NS(sym, sec, ns)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t