mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
export: fix string handling of namespace in EXPORT_SYMBOL_NS
[ Upstream commitd143b9db80
] Commitc3a6cf19e6
("export: avoid code duplication in include/linux/export.h") broke the ability for a defined string to be used as a namespace value. Fix this up by using stringify to properly encode the namespace name. Fixes:c3a6cf19e6
("export: avoid code duplication in include/linux/export.h") Cc: Miroslav Benes <mbenes@suse.cz> Cc: Emil Velikov <emil.l.velikov@gmail.com> Cc: Jessica Yu <jeyu@kernel.org> Cc: Quentin Perret <qperret@google.com> Cc: Matthias Maennich <maennich@google.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20220427090442.2105905-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
245b3fa3db
commit
e0de79aca6
1 changed files with 4 additions and 3 deletions
|
@ -2,6 +2,8 @@
|
||||||
#ifndef _LINUX_EXPORT_H
|
#ifndef _LINUX_EXPORT_H
|
||||||
#define _LINUX_EXPORT_H
|
#define _LINUX_EXPORT_H
|
||||||
|
|
||||||
|
#include <linux/stringify.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Export symbols from the kernel to modules. Forked from module.h
|
* Export symbols from the kernel to modules. Forked from module.h
|
||||||
* to reduce the amount of pointless cruft we feed to gcc when only
|
* to reduce the amount of pointless cruft we feed to gcc when only
|
||||||
|
@ -154,7 +156,6 @@ struct kernel_symbol {
|
||||||
#endif /* CONFIG_MODULES */
|
#endif /* CONFIG_MODULES */
|
||||||
|
|
||||||
#ifdef DEFAULT_SYMBOL_NAMESPACE
|
#ifdef DEFAULT_SYMBOL_NAMESPACE
|
||||||
#include <linux/stringify.h>
|
|
||||||
#define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, __stringify(DEFAULT_SYMBOL_NAMESPACE))
|
#define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, __stringify(DEFAULT_SYMBOL_NAMESPACE))
|
||||||
#else
|
#else
|
||||||
#define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
|
#define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
|
||||||
|
@ -162,8 +163,8 @@ struct kernel_symbol {
|
||||||
|
|
||||||
#define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
|
#define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
|
||||||
#define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
|
#define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
|
||||||
#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", #ns)
|
#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", __stringify(ns))
|
||||||
#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "_gpl", #ns)
|
#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "_gpl", __stringify(ns))
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue