module_init(): handle newer kernels that removed gpl_syms and num_gpl…#230
Closed
xuchunmei000 wants to merge 1 commit intocrash-utility:masterfrom
Closed
module_init(): handle newer kernels that removed gpl_syms and num_gpl…#230xuchunmei000 wants to merge 1 commit intocrash-utility:masterfrom
xuchunmei000 wants to merge 1 commit intocrash-utility:masterfrom
Conversation
…_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]>
|
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…_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:
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.