Bug 840267
Summary: | Modules compiled in F16 can't be inserted into 3.5-pre kernel | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Mitch Davis <mjd+redhat> | ||||||
Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> | ||||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | low | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | rawhide | CC: | dhowells, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2012-07-23 13:11:00 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Mitch Davis
2012-07-15 07:49:21 UTC
make V=1. Not sure what the "Kernel configuration is invalid" is about, but I think it should work anyway. [mjd@xiaomao hello-ko]$ make V=1 make -C /usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64 M=/home/mjd/src/hello-ko modules make[1]: Entering directory `/usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64' test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \ echo; \ echo " ERROR: Kernel configuration is invalid."; \ echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo; \ /bin/false) mkdir -p /home/mjd/src/hello-ko/.tmp_versions ; rm -f /home/mjd/src/hello-ko/.tmp_versions/* make -f scripts/Makefile.build obj=/home/mjd/src/hello-ko gcc -Wp,-MD,/home/mjd/src/hello-ko/.hello.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.6.3/include -I/usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64/arch/x86/include -Iarch/x86/include/generated -Iinclude -include /usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(hello)" -D"KBUILD_MODNAME=KBUILD_STR(hello)" -c -o /home/mjd/src/hello-ko/hello.o /home/mjd/src/hello-ko/hello.c if [ "-pg" = "-pg" ]; then if [ /home/mjd/src/hello-ko/hello.o != "scripts/mod/empty.o" ]; then /usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64/scripts/recordmcount "/home/mjd/src/hello-ko/hello.o"; fi; fi; (cat /dev/null; echo kernel//home/mjd/src/hello-ko/hello.ko;) > /home/mjd/src/hello-ko/modules.order make -f /usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64/scripts/Makefile.modpost scripts/mod/modpost -i /usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64/Module.symvers -I /home/mjd/src/hello-ko/Module.symvers -o /home/mjd/src/hello-ko/Module.symvers -S -w -s gcc -Wp,-MD,/home/mjd/src/hello-ko/.hello.mod.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.6.3/include -I/usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64/arch/x86/include -Iarch/x86/include/generated -Iinclude -include /usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(hello.mod)" -D"KBUILD_MODNAME=KBUILD_STR(hello)" -DMODULE -c -o /home/mjd/src/hello-ko/hello.mod.o /home/mjd/src/hello-ko/hello.mod.c ld -r -m elf_x86_64 -T /usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64/scripts/module-common.lds --build-id -o /home/mjd/src/hello-ko/hello.ko.unsigned /home/mjd/src/hello-ko/hello.o /home/mjd/src/hello-ko/hello.mod.o cp /home/mjd/src/hello-ko/hello.ko.unsigned /home/mjd/src/hello-ko/hello.ko make[1]: Leaving directory `/usr/src/kernels/3.5.0-0.rc4.git4.1.fc18.x86_64' [mjd@xiaomao hello-ko]$ The error message is similar to the one from bug 825944, however that was fixed quite some time ago and only impacted 32-bit. The build output shows your module being built as I would expect given that the modsign code is enabled but you obviously do not have the keys. So the mod-extract script isn't run to generate the ELF note that contains the signature and the unsigned module is just copied directly to the final module name. David, do you have any ideas on this one? With just a quick look at the modules provided: warthog>cmp hello.ko.unsigned hello.ko warthog> there is no signature attached to the module. This would seem to be corroborated by this bit of the build log excerpt: NO SIGN [M] /home/mjd/src/hello-ko/hello.ko Presumably because the keys weren't available to sign the module. I'll have to go and have a poke through the sources. Note that this isn't anything to do with SELinux, so fiddling with that shouldn't make any difference. Am I right in thinking that you're running the F-18 kernel under the F-16 system. Did you upgrade any of the build tools (binutils or elfutils) also? Thanks for looking at the problem David. (In reply to comment #3) > With just a quick look at the modules provided: > > warthog>cmp hello.ko.unsigned hello.ko > warthog> I get the same here. > Am I right in thinking that you're running the F-18 kernel under the F-16 > system. Yes, that's right. > Did you upgrade any of the build tools (binutils or elfutils) also? No, it's a stock, up-to-date F16 system, just running and compiling against an F18 kernel pulled down from koji. Mitch. Turning on DEBUG in the module verify code, shows that section 26 is failing on this test: seccheck((section->sh_offset & (section->sh_addralign - 1)) == 0); which doesn't work if sh_addralign is 0, like so: [26] .note.GNU-stack PROGBITS 0000000000000000 00013850 0000000000000000 0000000000000000 0 0 0 The modules I've built have alignment >= 1, like so: [34] .note.GNU-stack PROGBITS 0000000000000000 0000b809 0000000000000000 0000000000000000 X 0 0 1 However, the ELF spec says 0 and 1 specify no constraint. Created attachment 598652 [details]
/tmp/modsign.diff
Skip the ELF section alignment check if the alignment is 0 or 1 as the ELF spec says this means no alignment constraint. The problem with the sample kernel module is that one of the modules has a section with an alignment of 0, which causes the check to malfunction.
Thanks David. Mitch, I've started a scratch build of the latest rawhide kernel plus David's patch here: http://koji.fedoraproject.org/koji/taskinfo?taskID=4246657 When it completes, could you please install it, and grab the kernel-devel package as well and give your modules a test against it? Josh, Sorry, I didn't see this earlier. I've gone to the koji link, but I can't see any RPMs to download. Can you advise me what to do next please? Ahh I found them I think, here: http://koji.fedoraproject.org/koji/taskinfo?taskID=4246658 I'll see how I go. With that kernel I can now load kernel modules built in F16. Thank you! Any more testing I can do, please let me know. Just grab the latest rawhide kernel. I updated the modsign patches in it after I built the scratch build and it included David's patch already. Sigh. I should have read the rest of your messages before commenting earlier. Thank you very much for testing. As I said in the previous comment, we updated the modsign code and it contains this fix now. Your bug report is much appreciated! |