Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Another build issue #15

Open
lucabe72 opened this issue Jul 16, 2020 · 2 comments
Open

Another build issue #15

lucabe72 opened this issue Jul 16, 2020 · 2 comments

Comments

@lucabe72
Copy link

Hi,

I tried to build vbh with an older version of the Linux kernel (which has the definitions for ASM_VMX_VMREAD_RDX_RAX and similar),, but I get a new error:
[...]
CC [M] /home/luca/Src/Virt/vbh/sources/vbh_setup.o
AS [M] /home/luca/Src/Virt/vbh/sources/vmcall.o
CC [M] /home/luca/Src/Virt/vbh/sources/vcpu.o
LD [M] /home/luca/Src/Virt/vbh/sources/vmx-switch.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "__stack_chk_fail" [/home/luca/Src/Virt/vbh/sources/vmx-switch.ko] undefined!
[...]
and of course the module cannot be inserted in the kernel, because it tries to link the __stack_chk_fail symbol that does not exist...

It seems to me that the problem is due to the fact that you unconditionally add "-fstack-protector-strong" to the compiler options...
(as a side note, why are you adding all those cflags and ldflags? Doesn't kbuild use the correct flags by default?)

Thanks,
Luca

@sainath14
Copy link
Contributor

We just made it working with Linux kernel v5.4. Please give it a try.

@lucabe72
Copy link
Author

Hi,

I pulled the new commit, and I tried recompiling. Indeed, the issue with "ASM_VMX_VMREAD_RDX_RAX" & friends (bug #14) is fixed. But this specific bug (#15: __stack_chk_fail undefined) is still present.

So, I investigated it a little bit, and it seems that this bug happens when the vbh module is built against a kernel that has "CONFIG_STACKPROTECTOR_STRONG" disabled.
I think the bug is your "ccflags-y += $(INCLUDES) -O2 -Wall -fstack-protector-strong ..." in the Makefile: "-fstack-protector-strong" requires the kernel to define "__stack_chk_fail", so it cannot be used if the kernel is not built with "CONFIG_STACKPROTECTOR_STRONG=y"... On the other hand, if the kernel is built with "CONFIG_STACKPROTECTOR_STRONG=y" then kbuild automatically adds "-fstack-protector-strong" to the modules' build options (so your "ccflags-y += ..." seems to be redundant).

Luca

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

No branches or pull requests

2 participants