Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -3634,8 +3634,10 @@ module_init(void)
case KMOD_V2:
MEMBER_OFFSET_INIT(module_num_syms, "module", "num_syms");
MEMBER_OFFSET_INIT(module_list, "module", "list");
MEMBER_OFFSET_INIT(module_gpl_syms, "module", "gpl_syms");
MEMBER_OFFSET_INIT(module_num_gpl_syms, "module",
if (MEMBER_EXISTS("module", "gpl_syms"))
MEMBER_OFFSET_INIT(module_gpl_syms, "module", "gpl_syms");
if (MEMBER_EXISTS("module", "num_gpl_syms"))
MEMBER_OFFSET_INIT(module_num_gpl_syms, "module",
"num_gpl_syms");

if (MEMBER_EXISTS("module", "mem")) { /* 6.4 and later */
Expand Down Expand Up @@ -3830,8 +3832,9 @@ module_init(void)
nsyms = UINT(modbuf + OFFSET(module_nsyms));
break;
case KMOD_V2:
nsyms = UINT(modbuf + OFFSET(module_num_syms)) +
UINT(modbuf + OFFSET(module_num_gpl_syms));
nsyms = UINT(modbuf + OFFSET(module_num_syms));
if (VALID_MEMBER(module_num_gpl_syms))
nsyms += UINT(modbuf + OFFSET(module_num_gpl_syms));
break;
}

Expand Down
12 changes: 8 additions & 4 deletions symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -1976,9 +1976,11 @@ store_module_symbols_6_4(ulong total, int mods_installed)
"module buffer", FAULT_ON_ERROR);

syms = ULONG(modbuf + OFFSET(module_syms));
gpl_syms = ULONG(modbuf + OFFSET(module_gpl_syms));
gpl_syms = VALID_MEMBER(module_gpl_syms) ?
ULONG(modbuf + OFFSET(module_gpl_syms)) : 0;
nsyms = UINT(modbuf + OFFSET(module_num_syms));
ngplsyms = UINT(modbuf + OFFSET(module_num_gpl_syms));
ngplsyms = VALID_MEMBER(module_num_gpl_syms) ?
UINT(modbuf + OFFSET(module_num_gpl_syms)) : 0;

nksyms = UINT(modbuf + OFFSET(module_num_symtab));

Expand Down Expand Up @@ -2336,9 +2338,11 @@ store_module_symbols_v2(ulong total, int mods_installed)
"module buffer", FAULT_ON_ERROR);

syms = ULONG(modbuf + OFFSET(module_syms));
gpl_syms = ULONG(modbuf + OFFSET(module_gpl_syms));
gpl_syms = VALID_MEMBER(module_gpl_syms) ?
ULONG(modbuf + OFFSET(module_gpl_syms)) : 0;
nsyms = UINT(modbuf + OFFSET(module_num_syms));
ngplsyms = UINT(modbuf + OFFSET(module_num_gpl_syms));
ngplsyms = VALID_MEMBER(module_num_gpl_syms) ?
UINT(modbuf + OFFSET(module_num_gpl_syms)) : 0;

if (THIS_KERNEL_VERSION >= LINUX(2,6,27)) {
nksyms = UINT(modbuf + OFFSET(module_num_symtab));
Expand Down
Loading