Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 489034 - app-emulation/open-vm-tools-kmod-2013.09.16.1328054 - Makefile:1498: .vmlinux.cmd: Permission denied
Summary: app-emulation/open-vm-tools-kmod-2013.09.16.1328054 - Makefile:1498: .vmlinux...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
: 489032 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-22 17:03 UTC by Arnim Eijkhoudt
Modified: 2014-03-13 20:41 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (hardened-emerge-info.txt,19.52 KB, text/plain)
2013-10-24 12:17 UTC, Arnim Eijkhoudt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arnim Eijkhoudt 2013-10-22 17:03:11 UTC
Compile of open-vm-tools-kmod fails on a compiler error. Build log:

>>> Emerging (1 of 3) app-emulation/open-vm-tools-kmod-2013.09.16.1328054
 * open-vm-tools-2013.09.16-1328054.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                       [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     3.11.6-hardened
 * Checking for suitable kernel configuration options...                                                              [ ok ]
>>> Unpacking source...
>>> Unpacking open-vm-tools-2013.09.16-1328054.tar.gz to /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work
>>> Source unpacked in /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work
>>> Preparing source in /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054 ...
 * Applying vmhgfs-linux-3.11.patch ...                                                                               [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054 ...
 * Preparing vmxnet module
make -j5 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' auto-build 
Using kernel build system.
make -C /usr/src/linux/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-3.11.6-hardened'
Makefile:1498: .vmlinux.cmd: Permission denied
  CC [M]  /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet/vmxnet.o
cc1: error: cannot load plugin /usr/src/linux-3.11.6-hardened/tools/gcc/colorize_plugin.so
/usr/src/linux-3.11.6-hardened/tools/gcc/colorize_plugin.so: cannot open shared object file: Permission denied
make[2]: *** [/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet/vmxnet.o] Error 1
make[1]: *** [_module_/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet] Error 2
make[1]: Leaving directory `/usr/src/linux-3.11.6-hardened'
make: *** [vmxnet.ko] Error 2
 * ERROR: app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/temp/environment'.
 * Working directory: '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet'
 * S: '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054'

Reproducible: Always

Steps to Reproduce:
1. emerge open-vm-tools-kmod
2.
3.
Actual Results:  
cc1: error: cannot load plugin /usr/src/linux-3.11.6-hardened/tools/gcc/colorize_plugin.so
/usr/src/linux-3.11.6-hardened/tools/gcc/colorize_plugin.so: cannot open shared object file: Permission denied


Expected Results:  
Should compile normally.
Comment 1 Arnim Eijkhoudt 2013-10-22 17:22:47 UTC
*** Bug 489032 has been marked as a duplicate of this bug. ***
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-10-24 12:04:01 UTC
Please post your `emerge --info' output in a comment.
Comment 3 Arnim Eijkhoudt 2013-10-24 12:17:00 UTC
Created attachment 361786 [details]
emerge --info
Comment 4 Mike Gilbert gentoo-dev 2013-10-31 16:41:16 UTC
Can you give me a build log with MAKEOPTS=-j1?
Comment 5 Arnim Eijkhoudt 2013-11-01 10:34:24 UTC
Sure, no problem. Same error pops up:

===
<snipped> ~ # MAKEOPTS="-j1" emerge -v open-vm-tools-kmod

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] app-emulation/open-vm-tools-kmod-2013.09.16.1328054 [2012.12.26.958366] 0 kB

Total: 1 package (1 upgrade), Size of downloads: 0 kB


>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-emulation/open-vm-tools-kmod-2013.09.16.1328054
 * open-vm-tools-2013.09.16-1328054.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                       [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/3.11.6-hardened-r1/build
 * Found sources for kernel version:
 *     3.11.6-hardened-r1
 * Checking for suitable kernel configuration options...                                                              [ ok ]
>>> Unpacking source...
>>> Unpacking open-vm-tools-2013.09.16-1328054.tar.gz to /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work
>>> Source unpacked in /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work
>>> Preparing source in /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054 ...
 * Applying vmhgfs-linux-3.11.patch ...                                                                               [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054 ...
 * Preparing vmxnet module
make -j1 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' auto-build 
Using kernel build system.
make -C /lib/modules/3.11.6-hardened-r1/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-3.11.6-hardened-r1'
Makefile:1498: .vmlinux.cmd: Permission denied
  CC [M]  /var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet/vmxnet.o
cc1: error: cannot load plugin /usr/src/linux-3.11.6-hardened-r1/tools/gcc/colorize_plugin.so
/usr/src/linux-3.11.6-hardened-r1/tools/gcc/colorize_plugin.so: cannot open shared object file: Permission denied
make[2]: *** [/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet/vmxnet.o] Error 1
make[1]: *** [_module_/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet] Error 2
make[1]: Leaving directory `/usr/src/linux-3.11.6-hardened-r1'
make: *** [vmxnet.ko] Error 2
 * ERROR: app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/temp/environment'.
 * Working directory: '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet'
 * S: '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054'

>>> Failed to emerge app-emulation/open-vm-tools-kmod-2013.09.16.1328054, Log file:

>>>  '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/temp/build.log'

 * Messages for package app-emulation/open-vm-tools-kmod-2013.09.16.1328054:

 * ERROR: app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/open-vm-tools-kmod-2013.09.16.1328054::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/temp/environment'.
 * Working directory: '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054/modules/linux/vmxnet'
 * S: '/var/tmp/portage/app-emulation/open-vm-tools-kmod-2013.09.16.1328054/work/open-vm-tools-2013.09.16-1328054'
Comment 6 Mike Gilbert gentoo-dev 2013-11-01 14:29:36 UTC
Hmm... well the .vmlinux.cmd error does not appear to be fatal. The build is dying on this:

cc1: error: cannot load plugin /usr/src/linux-3.11.6-hardened-r1/tools/gcc/colorize_plugin.so

Since that is specific to hardened-sources, I'm passing this bug along to the hardened team.
Comment 7 Thibaud CANALE 2014-03-13 00:01:19 UTC
Hello,

I just discovered the same bug on '=app-emulation/virtualbox-modules-4.2.22::gentoo', with a lot of "cc1: error: XXX/XXX/file: Permission denied" stored in my actual kernel directory (linux-3.12.8-hardened-r1) because those files have “root:root 440 or 660” rights, and I have the userfetch FEATURE in portage, that's why accessing to those files is returning "Permission denied".

The quick (but maybe ugly) solution is to do a "chmod -R o=rX /usr/src/linux", or to disable the "userfetch" feature (I prefer to use chmod).

I think there is nothing to do about it, except doing the "chmod" command.

Best regards,
Comment 8 Mike Gilbert gentoo-dev 2014-03-13 01:47:09 UTC
userfetch should not affect the mode of files that are unpacked from a tarball.
Comment 9 Mike Gilbert gentoo-dev 2014-03-13 01:48:36 UTC
It is quite likely that the kernel was built with an overly restrictive umask value though. Lacking any other info, I'm going to blame this on user error.
Comment 10 Thibaud CANALE 2014-03-13 19:41:58 UTC
(In reply to Mike Gilbert from comment #9)
> It is quite likely that the kernel was built with an overly restrictive
> umask value though. Lacking any other info, I'm going to blame this on user
> error.

Yes, it's about the "umask 027" in /etc/profile (and in my shell's profile too), to avoid lack of security when doing useradd (which set new users' home directory in 755 by default, which is a problem).

I knew there is not really a lot to do about it; maybe doing a "chmod -R o=rX /usr/src/linux" before? Not a really good idea too.

Then, I think we should to a warning about it, in the ebuild. Then, no actions are doing without the user's agrees and knowledges, and it may be solved easily by the user on his/her own.

Best regards.
Comment 11 Mike Gilbert gentoo-dev 2014-03-13 20:41:34 UTC
(In reply to Thibaud "thican" CANALE from comment #10)
> (In reply to Mike Gilbert from comment #9)
> > It is quite likely that the kernel was built with an overly restrictive
> > umask value though. Lacking any other info, I'm going to blame this on user
> > error.
> 
> Yes, it's about the "umask 027" in /etc/profile (and in my shell's profile
> too), to avoid lack of security when doing useradd (which set new users'
> home directory in 755 by default, which is a problem).

You can set a default umask for useradd in /etc/login.defs