bug/section mismatches on 2.6.31 ?
Quoted 60 lines
Date: Sun, 20 Sep 2009 12:12:50 +0200
To: Sam Ravnborg <[email protected]>
From: Ro Achterberg <[email protected]>
Subject: Re: bug/section mismatches on 2.6.31 ?Quoted 39 lines · you
Quoted 6 lines · Ro Achterberg
Hi all,
I'm experiencing a kernel build problem that I haven't seen before. For some reason, make is telling me 'WARNING: modpost: Found 3133 section mismatch(es).' during the process. The currently running kernel is a 2.6.29.4-grsec (custom configuration) on CentOS 5.2. Gcc's version is 4.1.2, which I left untouched. I've built kernels on this machine before, without problems.
I've attached a log of 'make
CONFIG_DEBUG_SECTION_MISMATCH=y' which is not making a lot of sense to me, which is why I'm forwarding it to you, hoping that you might be able to tell me what I'm doing wrong here or whether perhaps I've encountered a bug here. Any insights would be greatly appreciated!Hi Ro.
I assume your are trying to build latest kernel. I could not reproduce it here - and from your logs nothing told me what is wrong at your side.
What I see is that modpost complain about a reference from .data to .text. And this is ok - so there is nothing to complain about.
I see a lot of warnings in your build that I do not see here. You seem to have more warnings enabled than is standard - but I do not see how this happens in your case.
kbuild should ignore CFLAGS settings from the environment but maybe we fail to ignore CFLAGS for host programs??First step is to isolate where to look for the issue. Try to run modpost manually:
modpost arch/x86/crypto/aes-x86_64.oDoes it generate the same warnigns as seen in your log - I hope so.
Then try to run modpost on the same .o file on another machine that does not exhibit this issue.
Does the other machine now suddenly show the warnings?In other words is this due to something in the .o file or due to something with modpost?
I assume the latter.Quoted 8 lines
You could also try to debug modpost a little - try to insert a breakpoint around
check_section_mismatch()and see when we trigger a mismatch.
That may give you a clue too.
[You need to adjust HOSTCFLAGS so -O2 is replaced with -g to do this. See top-levelMakefile.Sam
Hi Sam,
Many thanks for your quick and elaborate response. As you've undoubtedly noticed, I had cc'd Brad Spengler in this, who's been able to tell me that it is in fact grsec causing these section mismatch warnings. According to Brad: 'PaX modifies the modpost script so that we can get statistics on things like how many writable function pointers are in the kernel. These are considered "section mismatches." They don't affect the operation of the kernel, or its ability to be compiled.' I'll be confidently placing the server in the colocation rack now.
Take care, Ro