Masahiro Yamada
bf70b0503a
module: swap the order of symbol.namespace
...
Currently, EXPORT_SYMBOL_NS(_GPL) constructs the kernel symbol as
follows:
__ksymtab_SYMBOL.NAMESPACE
The sym_extract_namespace() in modpost allocates memory for the part
SYMBOL.NAMESPACE when '.' is contained. One problem is that the pointer
returned by strdup() is lost because the symbol name will be copied to
malloc'ed memory by alloc_symbol(). No one will keep track of the
pointer of strdup'ed memory.
sym->namespace still points to the NAMESPACE part. So, you can free it
with complicated code like this:
free(sym->namespace - strlen(sym->name) - 1);
It complicates memory free.
To fix it elegantly, I swapped the order of the symbol and the
namespace as follows:
__ksymtab_NAMESPACE.SYMBOL
then, simplified sym_extract_namespace() so that it allocates memory
only for the NAMESPACE part.
I prefer this order because it is intuitive and also matches to major
languages. For example, NAMESPACE::NAME in C++, MODULE.NAME in Python.
Reviewed-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-10-07 18:24:48 +02:00
..
atomic
locking/atomics: Use sed(1) instead of non-standard head(1) option
2019-06-25 10:17:07 +02:00
basic
kbuild: remove unneeded comments and code from scripts/basic/Makefile
2019-08-29 23:54:29 +09:00
coccinelle
scripts: add_namespace: Fix coccicheck failed
2019-10-07 16:37:53 +02:00
dtc
Devicetree updates for v5.3:
2019-07-11 18:35:30 -07:00
gcc-plugins
randstruct: Check member structs in is_pure_ops_struct()
2019-07-31 13:13:22 -07:00
gdb
scripts/gdb: handle split debug
2019-09-25 17:51:40 -07:00
genksyms
genksyms: convert to SPDX License Identifier for lex.l and parse.y
2019-09-14 11:40:13 +09:00
kconfig
merge_config.sh: ignore unwanted grep errors
2019-09-04 23:12:50 +09:00
ksymoops
mod
module: swap the order of symbol.namespace
2019-10-07 18:24:48 +02:00
package
kbuild: pkg: rename scripts/package/Makefile to scripts/Makefile.package
2019-08-25 07:42:00 +09:00
selinux
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
2019-05-30 11:26:35 -07:00
tracing
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166
2019-05-30 11:26:39 -07:00
.gitignore
adjust_autoksyms.sh
kbuild: remove the first line of *.mod files
2019-07-18 02:19:31 +09:00
asn1_compiler.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36
2019-05-24 17:27:11 +02:00
bin2c.c
bloat-o-meter
bootgraph.pl
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 391
2019-06-05 17:37:11 +02:00
bpf_helpers_doc.py
bpf: fix script for generating man page on BPF helpers
2019-05-13 01:12:45 +02:00
cc-can-link.sh
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166
2019-05-30 11:26:39 -07:00
checkpatch.pl
checkpatch: check for nested (un)?likely() calls
2019-09-25 17:51:42 -07:00
checkstack.pl
scripts/checkstack.pl: Fix arm64 wrong or unknown architecture
2019-06-05 02:33:10 +09:00
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config
conmakehash.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 54
2019-05-24 17:36:42 +02:00
const_structs.checkpatch
decode_stacktrace.sh
scripts/decode_stacktrace: Accept dash/underscore in modules
2019-07-12 11:05:41 -07:00
decodecode
depmod.sh
diffconfig
documentation-file-ref-check
scripts/documentation-file-ref-check: ignore output dir
2019-06-14 14:43:01 -06:00
export_report.pl
modpost: add support for symbol namespaces
2019-09-10 10:30:21 +02:00
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378
2019-06-05 17:37:10 +02:00
extract_xc3028.pl
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 339
2019-06-05 17:37:07 +02:00
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_compile_commands.py
gen_compile_commands: lower the entry count threshold
2019-07-27 12:18:19 +09:00
gen_ksymdeps.sh
get_abi.pl
doc: ABI scripts: add a SPDX header file
2019-06-21 16:58:37 +02:00
get_dvb_firmware
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61
2019-05-24 17:36:45 +02:00
get_maintainer.pl
get_maintainer: add ability to skip moderated mailing lists
2019-07-16 19:23:22 -07:00
gfp-translate
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166
2019-05-30 11:26:39 -07:00
headerdep.pl
headers_check.pl
headers_install.sh
kbuild: re-implement detection of CONFIG options leaked to user-space
2019-08-21 21:05:21 +09:00
insert-sys-cert.c
kallsyms.c
kallsyms: exclude kasan local symbols on s390
2019-07-08 02:25:59 +09:00
Kbuild.include
kbuild: remove unused objectify macro
2019-07-27 12:18:19 +09:00
Kconfig.include
kbuild: Fail if gold linker is detected
2019-08-14 01:10:42 +09:00
kernel-doc
kernel-doc: Allow anonymous enum
2019-08-12 15:00:37 -06:00
ld-version.sh
leaking_addresses.pl
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166
2019-05-30 11:26:39 -07:00
Lindent
link-vmlinux.sh
Kbuild updates for v5.4
2019-09-20 08:36:47 -07:00
Makefile
Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
2019-09-27 19:37:27 -07:00
Makefile.asm-generic
Makefile.build
kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN
2019-09-06 23:46:52 +09:00
Makefile.clean
kbuild: clean up subdir-ymn calculation in Makefile.clean
2019-08-29 23:54:29 +09:00
Makefile.dtbinst
Makefile.extrawarn
kbuild: allow Clang to find unused static inline functions for W=1 build
2019-09-09 23:55:43 +09:00
Makefile.gcc-plugins
Makefile.headersinst
kbuild: fix 'No such file or directory' warning for headers_install
2019-06-24 03:43:03 +09:00
Makefile.host
kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj)
2019-09-04 23:12:50 +09:00
Makefile.kasan
kasan/arm64: fix CONFIG_KASAN_SW_TAGS && KASAN_INLINE
2019-08-15 13:24:04 +01:00
Makefile.kcov
treewide: Add SPDX license identifier - Makefile/Kconfig
2019-05-21 10:50:46 +02:00
Makefile.lib
kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN
2019-09-06 23:46:52 +09:00
Makefile.modbuiltin
kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin}
2019-07-17 22:39:27 +09:00
Makefile.modfinal
kbuild: move modkern_{c,a}flags to Makefile.lib from Makefile.build
2019-08-22 01:14:11 +09:00
Makefile.modinst
kbuild: modinst: read modules.order instead of $(MODVERDIR)/*.mod
2019-07-17 22:39:27 +09:00
Makefile.modpost
Modules updates for v5.4
2019-09-22 10:34:46 -07:00
Makefile.modsign
kbuild: modsign: read modules.order instead of $(MODVERDIR)/*.mod
2019-07-17 22:39:27 +09:00
Makefile.package
kbuild: pkg: rename scripts/package/Makefile to scripts/Makefile.package
2019-08-25 07:42:00 +09:00
Makefile.ubsan
ubsan: Remove vla bound checks.
2019-05-06 11:12:09 -07:00
makelst
markup_oops.pl
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 373
2019-06-05 17:37:10 +02:00
mkcompile_h
Kbuild: Handle PREEMPT_RT for version string and magic
2019-08-14 01:10:42 +09:00
mkmakefile
kbuild: get rid of $(realpath ...) from scripts/mkmakefile
2019-08-29 23:54:29 +09:00
mksysmap
mkuboot.sh
module-common.lds
modules-check.sh
kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin}
2019-07-17 22:39:27 +09:00
namespace.pl
nsdeps
scripts: Coccinelle script for namespace dependencies.
2019-09-10 10:30:43 +02:00
objdiff
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 199
2019-05-30 11:29:23 -07:00
parse-maintainers.pl
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount: Clarify what cleanup() does
2019-08-31 12:19:40 -04:00
recordmcount.h
recordmcount: Remove redundant cleanup() calls
2019-08-31 12:19:40 -04:00
recordmcount.pl
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166
2019-05-30 11:26:39 -07:00
setlocalversion
show_delta
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 438
2019-06-05 17:37:17 +02:00
sign-file.c
sortextable.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378
2019-06-05 17:37:10 +02:00
sortextable.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378
2019-06-05 17:37:10 +02:00
spdxcheck-test.sh
spdxcheck.py
spdxcheck.py: fix directory structures
2019-06-01 15:51:31 -07:00
spelling.txt
scripts/spelling.txt: add more spellings to spelling.txt
2019-07-12 11:05:41 -07:00
sphinx-pre-install
scripts/sphinx-pre-install: seek for Noto CJK fonts for pdf output
2019-07-17 06:57:52 -03:00
split-man.pl
stackdelta
stackusage
subarch.include
tags.sh
kbuild: add a flag to force absolute path for srctree
2019-07-11 00:05:09 +09:00
tools-support-relr.sh
arm64: Add support for relocating the kernel with RELR relocations
2019-08-05 12:35:35 +01:00
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh