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> The subroutine "copy_from_user_overflow" is defined in lib/usercopy.c, and the 'Makefile' in the lib directory looks something like this: <snip from lib/Makefile> lib-$(CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS) += usercopy.o <snip from lib/Makefile> I think that this config option should be a built-in ('y') and I see that this config option is indeed set to 'y' in the .config file. <snip from .config> amit@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> So what am I missing here ? Some information about my git tree: amit@ubuntu:~/linux-next/linux-next$ git remote show origin * remote origin Fetch URL: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git amit@ubuntu:~/linux-next/linux-next$ git tag -l next-*|tail -n 1 next-20130314 <--- latest tag amit@ubuntu:~/linux-next/linux-next$ git branch * 15-March <--- -- branch based on the latest tag 22-Feb-13 -Amit
On 3/17/13, Kumar amit mehta <gmate.amit@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. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Mon, Mar 18, 2013 at 11:21:52AM +0700, Mulyadi Santosa wrote:
On 3/17/13, Kumar amit mehta <gmate.amit@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@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@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
Hi ... On Tue, Mar 19, 2013 at 12:28 PM, Kumar amit mehta <gmate.amit@gmail.com> wrote:
grep for copy_from_user_overflow gives me this:
amit@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)
IMHO, I think uaccess_32.h is what you need here. I draw that conclusion after checking this line: http://lxr.linux.no/#linux+v3.8.3/arch/x86/include/asm/uaccess_32.h#L194 I might be wrong, so feel free to test first -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Tue, Mar 19, 2013 at 09:43:11PM +0700, Mulyadi Santosa wrote:
Hi ...
On Tue, Mar 19, 2013 at 12:28 PM, Kumar amit mehta <gmate.amit@gmail.com> wrote:
grep for copy_from_user_overflow gives me this:
amit@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)
IMHO, I think uaccess_32.h is what you need here.
I draw that conclusion after checking this line: http://lxr.linux.no/#linux+v3.8.3/arch/x86/include/asm/uaccess_32.h#L194
I might be wrong, so feel free to test first
Actually the above header file is supposed to get included, based on the architecture only. <snip from arch/x86/include/asm/uaccess.h> #ifdef CONFIG_X86_32 # include <asm/uaccess_32.h> #else # include <asm/uaccess_64.h> #endif <snip from arch/x86/include/asm/uaccess.h> <snip from .config> amit@ubuntu:~/linux-next/linux-next$ grep -w CONFIG_X86_32 .config CONFIG_X86_32=y <snip from .config> CPU arch on my machine: amit@ubuntu:~/linux-next/linux-next$ uname -m i686 Based on this observation, I think, I do not need to include the uaccess_32.h in any of those files. -Amit
On Tue, Mar 19, 2013 at 11:56:44PM -0700, Kumar amit mehta wrote:
On Tue, Mar 19, 2013 at 09:43:11PM +0700, Mulyadi Santosa wrote:
Hi ...
On Tue, Mar 19, 2013 at 12:28 PM, Kumar amit mehta <gmate.amit@gmail.com> wrote:
grep for copy_from_user_overflow gives me this:
amit@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)
IMHO, I think uaccess_32.h is what you need here.
I draw that conclusion after checking this line: http://lxr.linux.no/#linux+v3.8.3/arch/x86/include/asm/uaccess_32.h#L194
I might be wrong, so feel free to test first
Actually the above header file is supposed to get included, based on the architecture only.
<snip from arch/x86/include/asm/uaccess.h> #ifdef CONFIG_X86_32 # include <asm/uaccess_32.h> #else # include <asm/uaccess_64.h> #endif <snip from arch/x86/include/asm/uaccess.h>
<snip from .config> amit@ubuntu:~/linux-next/linux-next$ grep -w CONFIG_X86_32 .config CONFIG_X86_32=y <snip from .config>
CPU arch on my machine: amit@ubuntu:~/linux-next/linux-next$ uname -m i686
Based on this observation, I think, I do not need to include the uaccess_32.h in any of those files.
I forgot that 'uname -m' will return me the kernel version and _not_ the CPU architecture. The CPU on my machine seem to be 64 bit (/proc/cpuinfo|grep flags shows 'lm'). So my understanding is that I've a 32 bit kernel running on a 64 bit machine.
Dear All: I now study power driver in linux source code, but didn't find some doc about liux,all the doc was for android, can some help me?BTW,how /sys/power interactive with linux kernel?? Many thanks
Dear All: I now study power driver in linux source code, but didn't find some doc about liux,all the doc was for android, can some help me?BTW,how /sys/power interactive with linux kernel?? Many thanks
Hi Ben, Please find the below the link to kernel power management related docs. https://www.kernel.org/doc/Documentation/power/basic-pm-debugging.txt This will explain about how /sys/power/ can be interactive. You can refer /sys/power/pm_test file for testing the power management functionality of linux kernel. Feel free to refer all other files in that directory. Regards, yuvaraj.A On Wed, Mar 20, 2013 at 3:19 PM, Ben Wu <crayben@yahoo.cn> wrote:
Dear All: I now study power driver in linux source code, but didn't find some doc about liux,all the doc was for android, can some help me?BTW,how /sys/power interactive with linux kernel??
Many thanks _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Wed, 20 Mar 2013 00:07:57 -0700, Kumar amit mehta said:
I forgot that 'uname -m' will return me the kernel version and _not_ the CPU architecture. The CPU on my machine seem to be 64 bit (/proc/cpuinfo|grep flags shows 'lm'). So my understanding is that I've a 32 bit kernel running on a 64 bit machine.
Or more correctly, you have a kernel actually running in 32-bit mode on a machine that is 64-bit capable.
Inline On Wed, Mar 20, 2013 at 12:07:57AM -0700, Kumar amit mehta wrote:
On Tue, Mar 19, 2013 at 11:56:44PM -0700, Kumar amit mehta wrote:
On Tue, Mar 19, 2013 at 09:43:11PM +0700, Mulyadi Santosa wrote:
Hi ...
On Tue, Mar 19, 2013 at 12:28 PM, Kumar amit mehta <gmate.amit@gmail.com> wrote:
grep for copy_from_user_overflow gives me this:
amit@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)
IMHO, I think uaccess_32.h is what you need here.
I draw that conclusion after checking this line: http://lxr.linux.no/#linux+v3.8.3/arch/x86/include/asm/uaccess_32.h#L194
I might be wrong, so feel free to test first
Actually the above header file is supposed to get included, based on the architecture only.
<snip from arch/x86/include/asm/uaccess.h> #ifdef CONFIG_X86_32 # include <asm/uaccess_32.h> #else # include <asm/uaccess_64.h> #endif <snip from arch/x86/include/asm/uaccess.h>
<snip from .config> amit@ubuntu:~/linux-next/linux-next$ grep -w CONFIG_X86_32 .config CONFIG_X86_32=y <snip from .config>
CPU arch on my machine: amit@ubuntu:~/linux-next/linux-next$ uname -m i686
Based on this observation, I think, I do not need to include the uaccess_32.h in any of those files.
Based on the above understanding, I didn't tried including uaccess_32.h in any of those files, complaining for copy_from_user_overflow symbol error [1], and Instead I thought I'll de-select these modules from being build and will thus not hit this issue. So now my .config file looks something like this: amit@ubuntu:~/linux-next/linux-next$ egrep -i 'pktgen|binfmt_misc|cxt1|isdn' .config # CONFIG_BINFMT_MISC is not set # CONFIG_NET_PKTGEN is not set # CONFIG_ISDN is not set # CONFIG_CXT1E1 is not set I didn't face any issue with the build now and while trying to boot from this newly built kernel, I found myself hopelessly staring at the screen, which seem to have stuck in the boot process. I think the kernel configuration file and the boot screenshot can be helpful for inspecting this boot issue. But before attaching these small files(136K and 32K respectively) and send it to the mailing list, I'd like to ask, if that's fine with you folks. [1] build error when modules such as pktgen are selected: 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!
I forgot that 'uname -m' will return me the kernel version and _not_ the CPU architecture. The CPU on my machine seem to be 64 bit (/proc/cpuinfo|grep flags shows 'lm'). So my understanding is that I've a 32 bit kernel running on a 64 bit machine.
On Thu, Mar 21, 2013 at 1:16 PM, Kumar amit mehta <gmate.amit@gmail.com> wrote: boot issue. But
before attaching these small files(136K and 32K respectively) and send it to the mailing list, I'd like to ask, if that's fine with you folks.
maybe it's better if you upload those files somewhere, maybe google docs and send the link here. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Fri, Mar 22, 2013 at 10:41:56AM +0700, Mulyadi Santosa wrote:
On Thu, Mar 21, 2013 at 1:16 PM, Kumar amit mehta <gmate.amit@gmail.com> wrote: boot issue. But
before attaching these small files(136K and 32K respectively) and send it to the mailing list, I'd like to ask, if that's fine with you folks.
maybe it's better if you upload those files somewhere, maybe google docs and send the link here.
I've uploaded the kernel configuration and the screenshot in google drive [1]. With these particular settings, I'm able to build the kernel, but still not able to boot from it: $ egrep -i 'pktgen|binfmt_misc|cxt1|isdn' .config CONFIG_BINFMT_MISC=y # CONFIG_NET_PKTGEN is not set # CONFIG_ISDN is not set # CONFIG_CXT1E1 is not set Just to be a little more verbose, I've listed below the steps that I follow to build and boot from the newly built kernel on my ubuntu box: $ sudo apt-get install build-essential $ make oldconfig $ make -jX all ;;Where X= Number of CPU cores $ sudo make modules_install install $ sudo update-grub $ sudo shutdown -y now [1] https://docs.google.com/folder/d/0B4un01St9Hdsb18xYU1yaF9ET0U/edit?usp=shari... Please let me know if you face any problem in accessing these. -Amit
On 3/22/13, Kumar amit mehta <gmate.amit@gmail.com> wrote:
I've uploaded the kernel configuration and the screenshot in google drive [1].
ok let's see........... hmmm, stuck during I/O memory mapping?..... sadly, no further info that explains the reason why it stuck there....
Just to be a little more verbose, I've listed below the steps that I follow to build and boot from the newly built kernel on my ubuntu box:
$ sudo apt-get install build-essential $ make oldconfig $ make -jX all ;;Where X= Number of CPU cores
somewhere I've read that to make sure compilation goes without any glitches, better run without any -j at all.
$ sudo make modules_install install
regarding kernel image install, I usually do manual copy to /boot and adjust Grub config manually. Then when it comes to modules compilation and installation, usually I do : sudo make modules sudo make modules_install
$ sudo update-grub $ sudo shutdown -y now
try not using "quiet" kernel parameter, in case you currently use it. check /etc/default/grub..... and re run update-grub. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Sun, Mar 24, 2013 at 12:49:55PM +0700, Mulyadi Santosa wrote:
On 3/22/13, Kumar amit mehta <gmate.amit@gmail.com> wrote:
I've uploaded the kernel configuration and the screenshot in google drive [1].
ok let's see........... hmmm, stuck during I/O memory mapping?..... sadly, no further info that explains the reason why it stuck there....
Just to be a little more verbose, I've listed below the steps that I follow to build and boot from the newly built kernel on my ubuntu box:
$ sudo apt-get install build-essential $ make oldconfig $ make -jX all ;;Where X= Number of CPU cores
somewhere I've read that to make sure compilation goes without any glitches, better run without any -j at all.
$ sudo make modules_install install
regarding kernel image install, I usually do manual copy to /boot and adjust Grub config manually.
Then when it comes to modules compilation and installation, usually I do : sudo make modules sudo make modules_install
$ sudo update-grub $ sudo shutdown -y now
try not using "quiet" kernel parameter, in case you currently use it. check /etc/default/grub..... and re run update-grub.
Thank you so much for your help. Meanwhile I have updated my workspace with the latest linux-next tree and will later try out the options that you've mentioned. -Amit
On 3/25/13, Kumar amit mehta <gmate.amit@gmail.com> wrote:
Thank you so much for your help. Meanwhile I have updated my workspace with the latest linux-next tree and will later try out the options that you've mentioned.
You welcome. BTW, (fortunately you already done so), it's better to retest against latest linux-next tree. because possibly you hit a corner case error. And also if it's still possible, test against latest stable. That way. you will get better coverage on what's really going on. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (5)
-
Ben Wu -
Kumar amit mehta -
Mulyadi Santosa -
Valdis.Kletnieks@vt.edu -
Yuva Raj