Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux post-6.3 'struct module' has no member named 'core_layout' #267

Closed
solardiz opened this issue Apr 28, 2023 · 4 comments
Closed

Linux post-6.3 'struct module' has no member named 'core_layout' #267

solardiz opened this issue Apr 28, 2023 · 4 comments
Assignees

Comments

@solardiz
Copy link
Contributor

https://github.com/lkrg-org/lkrg/actions/runs/4829549515/jobs/8604723001

make[1]: Entering directory '/usr/src/linux-headers-6.3.0-060300daily20230428-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.2.0-17ubuntu1) 12.2.0
  You are using:           gcc-12 (Ubuntu 12.2.0-17ubuntu1) 12.2.0
  CC [M]  /root/src/src/modules/ksyms/p_resolve_ksym.o
  CC [M]  /root/src/src/modules/hashing/p_lkrg_fast_hash.o
In file included from /root/src/src/modules/ksyms/../../p_lkrg_main.h:405,
                 from /root/src/src/modules/ksyms/p_resolve_ksym.c:19:
/root/src/src/modules/ksyms/../../modules/wrap/p_struct_wrap.h: In function 'p_module_core':
/root/src/src/modules/ksyms/../../modules/wrap/p_struct_wrap.h:106:16: error: 'struct module' has no member named 'core_layout'
  106 |    return p_mod->core_layout.base;
      |                ^~
@Adam-pi3
Copy link
Collaborator

New changes are coming which we need to take into account:
torvalds/linux@ac3b432

@Adam-pi3 Adam-pi3 self-assigned this Apr 29, 2023
@solardiz solardiz changed the title Linux 6.3 'struct module' has no member named 'core_layout' Linux post-6.3 'struct module' has no member named 'core_layout' Apr 30, 2023
@solardiz
Copy link
Contributor Author

Linux 6.3 had been released a few days before this change was merged, which was part of tag modules-6.4-rc1. So LKRG builds on the Linux 6.3 release fine, and we need to fix this issue in time for 6.4 (of course, the sooner the better).

torvalds/linux@b6a7828

Adam-pi3 added a commit that referenced this issue May 3, 2023
Linux kernel post-6.3 modified the 'struct module' and introduced a new
substructure describing module's memory layout. Additionally, the logic for
dynamic debug (ddebug) has been modified and some of the functions which LKRG
uses are no longer exported. This commit adopts to these post-6.3 changed and
addresses #267
@Adam-pi3
Copy link
Collaborator

Adam-pi3 commented May 3, 2023

As for now, I've added verification against KERNEL_VERSION(6, 4, 0) which means before LINUX_VERSION_CODE is bumped we would see compilation failure. If some of the changes are going to be adopted in 6.3.2+, we can adjusted necessary KERNEL_VERSION checks.

@solardiz
Copy link
Contributor Author

This issue is fixed, so I'll close, but we need to remember to document it properly in our next release. We haven't updated CHANGES since the LKRG 0.9.6 release last December - that's not great. I assume we'll go over the commits to produce a new CHANGES entry for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants