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

Building custom kernel modules requires CONFIG_STACK_VALIDATION= in 1.4.0 #2374

Closed
ryansch opened this Issue May 31, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@ryansch

ryansch commented May 31, 2018

RancherOS Version: (ros os version)
v1.4.0
Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)
docker-machine

I have side by side attempts to build https://github.com/maK-/SimplestLKM in a container with the `kernel-headers' service enabled.

1.3.0:

# make
make -C /lib/modules/4.9.80-rancher/build M=/root/SimplestLKM modules
make[1]: Entering directory '/lib/modules/4.9.80-rancher/build'
  CC [M]  /root/SimplestLKM/hello.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /root/SimplestLKM/hello.mod.o
  LD [M]  /root/SimplestLKM/hello.ko
make[1]: Leaving directory '/lib/modules/4.9.80-rancher/build'

1.4.0:

# make
make -C /lib/modules/4.14.32-rancher2/build M=/root/SimplestLKM modules
make[1]: Entering directory '/lib/modules/4.14.32-rancher2/build'
make[2]: *** No rule to make target 'tools/objtool/objtool', needed by '/root/SimplestLKM/hello.o'.  Stop.
Makefile:1528: recipe for target '_module_/root/SimplestLKM' failed
make[1]: *** [_module_/root/SimplestLKM] Error 2
make[1]: Leaving directory '/lib/modules/4.14.32-rancher2/build'
Makefile:12: recipe for target 'default' failed
make: *** [default] Error 2
@ryansch

This comment has been minimized.

ryansch commented May 31, 2018

This specifically prevents us from building the parallels guest tools.

@ryansch

This comment has been minimized.

ryansch commented May 31, 2018

More information:
https://lists.debian.org/debian-knoppix/2017/01/msg00002.html

# make CONFIG_STACK_VALIDATION= works

@ryansch

This comment has been minimized.

@ryansch

This comment has been minimized.

ryansch commented Jun 1, 2018

Here's a functional workaround for this issue: outstand/docker-parallels-tools@6f0188f

@niusmallnan

This comment has been minimized.

Member

niusmallnan commented Jun 1, 2018

Yes, I also feel pain for it.

The build failure appears to have been introduced by a regression in the kernel packaging which breaks all out-of-tree-module builds. The objtool binary is no longer being included and it is required for external module builds when the kernel is compiled with CONFIG_STACK_VALIDATION=y.

@ryansch ryansch changed the title from Building custom kernel modules is broken in 1.4.0 to Building custom kernel modules requires CONFIG_STACK_VALIDATION= in 1.4.0 Jun 4, 2018

@niusmallnan niusmallnan added this to the v1.5.0 milestone Jun 5, 2018

@zhoubofsy zhoubofsy added the area/boot label Jun 27, 2018

@zhoubofsy

This comment has been minimized.

zhoubofsy commented Jul 2, 2018

@ryansch @niusmallnan
Kernel with CONFIG_STACK_VALIDATION, it use objtool to perform stack metadata validation on object file ("*.o") when compile third kernel modules. The objtool is generated in ./tool/objtool directory when building kernel, but there isn't objtool in RancherOS.

There are three way to eliminate influence of STACK_VALIDATAION :

1. Compile source with "CONFIG_STACK_VALIDATION=", it doesn't perform stack metadate validation
2. Copy the objtool into RancherOS and build again
3. Rebuild kernel without "STACK_VALIDATION" of "arch/Kconfig", and chose "CONFIG_UNWINDER_GUESS" instead of "CONFIG_UNWINDER_ORC" or "CONFIG_UNWINDER_FRAME_POINTER"

I recommend the first.
Edit by @niusmallnan: recommend the second.

@rootwuj

This comment has been minimized.

rootwuj commented Aug 28, 2018

Tested with RancherOS version- v1.4.1-rc2 with AWS.
This version can successfully build SimplestLKM.

@rootwuj rootwuj closed this Aug 28, 2018

@niusmallnan niusmallnan added BACKPORTED and removed BACKPORT labels Sep 16, 2018

@niusmallnan

This comment has been minimized.

Member

niusmallnan commented Sep 19, 2018

Backported to v1.4.1.

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