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

compilation error on RHEL >= 9.4 #1898

Closed
andrei-danschikov opened this issue Jun 7, 2024 · 5 comments
Closed

compilation error on RHEL >= 9.4 #1898

andrei-danschikov opened this issue Jun 7, 2024 · 5 comments
Labels
kind/bug Something isn't working
Milestone

Comments

@andrei-danschikov
Copy link

andrei-danschikov commented Jun 7, 2024

hi there!
we are facing scap module compilation error on RHEL 9.4:

**_CC [M] /var/lib/dkms/scap/7.0.0+driver/build/main.o
In file included from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from ./include/linux/list.h:9,
from ./include/linux/smp.h:12,
from ./include/linux/tracepoint.h:15,
from ./include/trace/syscall.h:5,
from /var/lib/dkms/scap/7.0.0+driver/build/main.c:14:
/var/lib/dkms/scap/7.0.0+driver/build/main.c: In function 'scap_init':
./include/linux/export.h:17:22: error: passing argument 1 of 'class_create' from incompatible pointer type [-Werror=incompatible-pointer-types]
17 | #define THIS_MODULE (&__this_module)
| ~^~~~~~~~~~~~~~~
| |
| struct module *
/var/lib/dkms/scap/7.0.0+driver/build/main.c:2877:36: note: in expansion of macro 'THIS_MODULE'
2877 | g_ppm_class = class_create(THIS_MODULE, DRIVER_DEVICE_NAME);
| ^~~~~~~~~~~
In file included from ./include/linux/device.h:31,
from ./include/linux/node.h:18,
from ./include/linux/cpu.h:17,
from ./include/linux/static_call.h:135,
from ./include/linux/tracepoint.h:22:
./include/linux/device/class.h:230:54: note: expected 'const char *' but argument is of type 'struct module '
230 | struct class * __must_check class_create(const char name);
| ~~~~~~~~~~~~^~~~
/var/lib/dkms/scap/7.0.0+driver/build/main.c:2877:23: error: too many arguments to function 'class_create'
2877 | g_ppm_class = class_create(THIS_MODULE, DRIVER_DEVICE_NAME);
| ^~~~~~~~~~~~
./include/linux/device/class.h:230:29: note: declared here
230 | struct class * _must_check class_create(const char *name);
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors

As we understand class_create patch backported to ReadHat, if we make the following change the compilation succeeds:
if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)) || (PPM_RHEL_RELEASE_CODE > 0 && PPM_RHEL_RELEASE_CODE >= PPM_RHEL_RELEASE_VERSION(9, 4))
g_ppm_class = class_create(DRIVER_DEVICE_NAME);
else
g_ppm_class = class_create(THIS_MODULE, DRIVER_DEVICE_NAME);
endif

is it possible to add the above to scap driver code?

@andrei-danschikov andrei-danschikov added the kind/bug Something isn't working label Jun 7, 2024
@albe19029
Copy link
Contributor

Good day. We have the same issue. Is it possible to fix RHEL >= 9.4 compilation error?

@FedeDP
Copy link
Contributor

FedeDP commented Jun 13, 2024

Hi! Thanks for opening this issue!
This build failure should've been already addressed by #1452 in 7.2.0+driver, that is part of Falco 0.38.0.
Can you test with it?

@albe19029
Copy link
Contributor

I see that there are configure folder with test modules starting from 7.1.0+driver. And changes are there in image starting from sysdig 0.37.0. This should work. Thanks a lot for help

@FedeDP
Copy link
Contributor

FedeDP commented Jun 13, 2024

I see that there are configure folder with test modules starting from 7.1.0+driver

Exactly :)

@FedeDP
Copy link
Contributor

FedeDP commented Jun 13, 2024

/milestone 0.18.0

@poiana poiana added this to the 0.18.0 milestone Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants