]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
modpost: fix section mismatch check for exported init/exit sections
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 10 Jun 2022 18:32:30 +0000 (03:32 +0900)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:54:02 +0000 (10:54 +0200)
BugLink: https://bugs.launchpad.net/bugs/1986718
commit 28438794aba47a27e922857d27b31b74e8559143 upstream.

Since commit f02e8a6596b7 ("module: Sort exported symbols"),
EXPORT_SYMBOL* is placed in the individual section ___ksymtab(_gpl)+<sym>
(3 leading underscores instead of 2).

Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL
and __init/__exit.

Fix the .fromsec field.

Fixes: f02e8a6596b7 ("module: Sort exported symbols")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
scripts/mod/modpost.c

index 94041ee32798fd7a7dea557653ab9347ba5ad050..b284ee01fdebb90a95213c55b6e99c107de88b08 100644 (file)
@@ -1108,7 +1108,7 @@ static const struct sectioncheck sectioncheck[] = {
 },
 /* Do not export init/exit functions or data */
 {
-       .fromsec = { "__ksymtab*", NULL },
+       .fromsec = { "___ksymtab*", NULL },
        .bad_tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
        .mismatch = EXPORT_TO_INIT_EXIT,
        .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },