Skip to content

module_init(): handle newer kernels that removed gpl_syms and num_gpl…#230

Closed
xuchunmei000 wants to merge 1 commit intocrash-utility:masterfrom
xuchunmei000:master
Closed

module_init(): handle newer kernels that removed gpl_syms and num_gpl…#230
xuchunmei000 wants to merge 1 commit intocrash-utility:masterfrom
xuchunmei000:master

Conversation

@xuchunmei000
Copy link
Copy Markdown

…_syms

In Linux kernel commit 55fcb92 ("module: use kflagstab instead of *_gpl sections") and b4760ff ("module: deprecate usage of *_gpl sections in module loader"), the kernel merged GPL-only symbol sections into the regular symbol table, tracked by a new per-symbol flags table (kflagstab). This removed the following fields from struct module:

  • num_gpl_syms
  • gpl_syms
  • gpl_crcs

Without this patch, crash fails to start a session with a newer kernel vmcore with this error:

crash: invalid structure member offset: module_num_gpl_syms
FILE: kernel.c LINE: 3834 FUNCTION: module_init()

The fix makes the gpl_syms/num_gpl_syms member initialization and usage conditional in both module_init() and store_module_symbols() paths. When these members do not exist, gpl_syms is set to 0 and ngplsyms is set to 0, so the GPL symbol loading loops are simply skipped.

This is consistent with how the kernel itself now handles symbols: all exported symbols (including GPL-only) are stored in a single syms array with per-symbol flags in flagstab.

…_syms

In Linux kernel commit 55fcb92 ("module: use kflagstab instead of
*_gpl sections") and b4760ff ("module: deprecate usage of *_gpl
sections in module loader"), the kernel merged GPL-only symbol
sections into the regular symbol table, tracked by a new per-symbol
flags table (kflagstab).  This removed the following fields from
struct module:

  - num_gpl_syms
  - gpl_syms
  - gpl_crcs

Without this patch, crash fails to start a session with a newer
kernel vmcore with this error:

  crash: invalid structure member offset: module_num_gpl_syms
         FILE: kernel.c  LINE: 3834  FUNCTION: module_init()

The fix makes the gpl_syms/num_gpl_syms member initialization and
usage conditional in both module_init() and store_module_symbols()
paths.  When these members do not exist, gpl_syms is set to 0 and
ngplsyms is set to 0, so the GPL symbol loading loops are simply
skipped.

This is consistent with how the kernel itself now handles symbols:
all exported symbols (including GPL-only) are stored in a single
syms array with per-symbol flags in flagstab.

Signed-off-by: Chunmei Xu <[email protected]>
@github-actions
Copy link
Copy Markdown

The github repo does not accept PRs, please subscribe to mail list via https://lists.crash-utility.osci.io/admin/lists/devel.lists.crash-utility.osci.io/ for contribution and discussion. Or post your patch to mail list: [email protected]

@github-actions github-actions Bot closed this Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant