kernel build error

Kumar amit mehta gmate.amit at gmail.com
Tue Mar 19 01:28:27 EDT 2013


On Mon, Mar 18, 2013 at 11:21:52AM +0700, Mulyadi Santosa wrote:
> On 3/17/13, Kumar amit mehta <gmate.amit at gmail.com> wrote:
> > I'm facing a kernel build issue with the latest kernel on my machine. It
> > seem
> > like a configuration issue, and I haven't been able to resolve it for
> > sometime,
> > hence need your help. The error message is as below:
> >
> > <error snip>
> > ERROR: "copy_from_user_overflow" [net/core/pktgen.ko] undefined!
> > ERROR: "copy_from_user_overflow" [fs/binfmt_misc.ko] undefined!
> > ERROR: "copy_from_user_overflow" [drivers/staging/cxt1e1/cxt1e1.ko]
> > undefined!
> > ERROR: "copy_from_user_overflow" [drivers/isdn/icn/icn.ko] undefined!
> > ERROR: "copy_from_user_overflow" [drivers/isdn/hardware/avm/b1.ko]
> > undefined!
> > <error snip>
> 
> Looks like a .h (header) file is missing on those files (icn, pktgen
> etc). A header that defines copy_from_user_overflow() for sure.
> 
> Maybe grep can help.
>

grep for copy_from_user_overflow gives me this:

amit at ubuntu:~/linux-next/linux-next$ grep -ri copy_from_user_overflow *
arch/s390/include/asm/uaccess.h:extern void copy_from_user_overflow(void)
arch/s390/include/asm/uaccess.h:		copy_from_user_overflow();
arch/tile/include/asm/uaccess.h:extern void copy_from_user_overflow(void)
arch/tile/include/asm/uaccess.h:		copy_from_user_overflow();
arch/parisc/include/asm/uaccess.h:extern void copy_from_user_overflow(void)
arch/parisc/include/asm/uaccess.h:                copy_from_user_overflow();
arch/x86/include/asm/uaccess_32.h:extern void copy_from_user_overflow(void)
arch/x86/include/asm/uaccess_32.h:		copy_from_user_overflow();
drivers/vfio/pci/vfio_pci_config.c:	 * with count of 1/2/4 and hits
copy_from_user_overflow without this.
lib/usercopy.c:void copy_from_user_overflow(void)
lib/usercopy.c:EXPORT_SYMBOL(copy_from_user_overflow);

I've been happily building kernel for previous releases and this issue seem to
have creeped up recently, therefore I looked into the changelogs and found that
recently there has been some modification in the arch/x86/Kconfig
$ git blame --since=3.weeks -- arch/x86/Kconfig 
7cb72f24 (Stephen Boyd     2013-03-10 21:55:49 +1100   23)      select
ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS  <-- gives me some pointer

$ git log 7cb72f24 
<snip>
To simplify the rewording, consolidate the text into lib/Kconfig.debug and
modify it there to be more explicit about when you should say N to this
config.
........

While we're doing this, remove all the copy_from_user_overflow() code
that's duplicated many times and place it into lib/ so that any
architecture supporting this option can get the function for free.
<snip>

<snip from lib/Kconfig.debug>
config ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
        bool 

config DEBUG_STRICT_USER_COPY_CHECKS
        bool "Strict user copy size checks"
        depends on ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
        depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
        help 
          Enabling this option turns a certain set of sanity checks for user 
          copy operations into compile time failures.

          The copy_from_user() etc checks are there to help test if there
          are sufficient security checks on the length argument of
          the copy operation, by having gcc prove that the argument is
          within bounds.

          If unsure, say N.
<snip from lib/Kconfig.debug>

As I've mentioned before, copy_from_user_overflow is defined and exported in 
lib/usercopy.c and my .config file has
CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS set to 'y'
<snip from .config>

amit at ubuntu:~/linux-next/linux-next$ grep
CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS .config
CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS=y
<snip from .config>

I've not been able to figure out the required header file so far.

Thanks,
Amit



More information about the Kernelnewbies mailing list