Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 386721 - app-emulation/open-vm-tools-kmod-0.0.20110821.471295 fails to build against hardened-sources-3.0.4-r1
Summary: app-emulation/open-vm-tools-kmod-0.0.20110821.471295 fails to build against h...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Gentoo VMWare Bug Squashers [disabled]
Depends on:
Reported: 2011-10-11 07:10 UTC by Martin Kolleck
Modified: 2012-10-22 10:50 UTC (History)
7 users (show)

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

Build log. (build.log,7.44 KB, text/plain)
2011-10-11 07:16 UTC, Martin Kolleck
Output of `emerge --info`. (emerge-info.txt,15.26 KB, text/plain)
2011-10-11 07:16 UTC, Martin Kolleck
vmci driver.c patch (vmci-driver.patch,1.80 KB, patch)
2011-10-13 20:46 UTC, Andrew Dean
Details | Diff
Ebuild to apply vmci-driver.patch (open-vm-tools-kmod-0.0.20110923.491607-r1.ebuild,1.80 KB, text/plain)
2011-10-13 20:46 UTC, Andrew Dean
Script to place in /etc/portage/postsync.d (open-vm-tools-kmod,4.13 KB, text/plain)
2011-12-08 21:26 UTC, Martin Kolleck

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Kolleck 2011-10-11 07:10:57 UTC
open-vm-tools-kmod fails to build since the stabilization of hardened-sources-3.0.4-r1. The problem has also been reported on the forum

Reproducible: Always

Steps to Reproduce:
1. Have a hardened profile.
2. Update to the latest stable kernel version (currently 3.0.4-r1)
3. Try to emerge open-vm-tools-kmod.

Actual Results:  
Build fails with the following error (occurs several times)

/var/tmp/portage/app-emulation/open-vm-tools-kmod-0.0.20110821.471295/work/open-vm-tools-2011.08.21-471295/modules/linux/vmci/linux/driver.c:388:4: error: assignment of read-only variable ‘vmuser_fops’

See attached build log.
Comment 1 Martin Kolleck 2011-10-11 07:16:23 UTC
Created attachment 289513 [details]
Build log.
Comment 2 Martin Kolleck 2011-10-11 07:16:50 UTC
Created attachment 289515 [details]
Output of `emerge --info`.
Comment 3 Arnim Eijkhoudt 2011-10-11 20:39:54 UTC
I'm experiencing the same problem (author of the post on the forums).
Comment 4 Tom Hendrikx 2011-10-12 11:38:20 UTC
I can also confirm this happens.
Comment 5 Frank Limpert 2011-10-13 10:34:27 UTC
This appens here too on x86 and amd64. I even tried open-vm-tools-kmod-0.0.20110923.491607 that gave the same errors.
Comment 6 Andrew Dean 2011-10-13 20:46:08 UTC
Created attachment 289757 [details, diff]
vmci driver.c patch

Does static initialization of vmuser_fops structure.
Comment 7 Andrew Dean 2011-10-13 20:46:47 UTC
Created attachment 289759 [details]
Ebuild to apply vmci-driver.patch
Comment 8 Andrew Dean 2011-10-13 20:48:21 UTC
The patch and ebuild I just attached allows open-vm-tools-kmod to compile on my hardened x64 VM.  Of course, this needs better testing, so use at your own risk.
Comment 9 Frank Limpert 2011-10-25 15:02:21 UTC
Your patch and ebuild works for me with open-vm-tools-kmod-0.0.20110923.491607 on x86 and amd64. Please commit these to the portage tree.
Comment 10 Arnim Eijkhoudt 2011-11-05 22:13:00 UTC
Can someone please get the fixes upstream? This bug report is still listed as UNCONFIRMED as well for some reason?
Comment 11 Martin Kolleck 2011-11-08 15:39:58 UTC
Works for me as well. For now I embedded the patch and ebuild into a script that is placed in /etc/portage/postsync.d.

As for UNCONFIRMED: I cannot change the status to anything besides RESOLVED, which it isn't.
Comment 12 Arnim Eijkhoudt 2011-12-08 17:14:48 UTC
This issue is still open, listed as unconfirmed and still exists right up to the latest version of open-vm-tools-kmod. Is there anything we/I can do to get this merged into the tree?

@Martin Kolleck: is there any chance you could post the postsync.d script for me?
Comment 13 Martin Kolleck 2011-12-08 21:26:12 UTC
Created attachment 295221 [details]
Script to place in /etc/portage/postsync.d

Don't forget to make the script executable.

When syncing the portage tree, the patch file and the ebuild that applies the patch are removed. With this script in place, these files are recreated.

The script is far from perfect. It uses 'patch' instead of 'cat' because I created it from a diff on the tree. Also, you'll need to update the version number in the script every time there's a new ebuild in the tree.
Comment 14 Faustus 2011-12-13 10:31:46 UTC
On x86 (not amd64) hardened-sources-3.0.4-r5, I'm getting:

Using 2.6.x kernel build system.
make: *** No rule to make target `auto-build'.  Stop.
Comment 15 Martin Kolleck 2011-12-13 12:10:39 UTC
Faustus: Sorry, I cannot reproduce this error. I just tried to install open-vm-tool-kmod-2011.11.20.535097 with the above patches in place in a mostly stable x86 hardened environment. It worked like a charm.
Comment 16 Kai Krakow 2011-12-14 16:39:46 UTC
I can still reproduce this on hardened amd64 with hardened-sources-3.0.4-r5 and app-emulation/open-vm-tools-kmod-2011.11.20.535097...

So this is still an issue in newer versions of the package.
Comment 17 Faustus 2011-12-19 15:33:11 UTC
(In reply to comment #15)
> Faustus: Sorry, I cannot reproduce this error. I just tried to install
> open-vm-tool-kmod-2011.11.20.535097 with the above patches in place in a mostly
> stable x86 hardened environment. It worked like a charm.

Indeed, it was a problem on my side - had a VERSION environment variable set. Good old bug #56407 strikes again...
Comment 18 Tom Hendrikx 2012-02-03 20:39:07 UTC
There are currently 2 hardened-sources ebuilds available that are no longer vulnerable w.r.t. CVE-2012-0056 (2.6.32-r89 and 3.2.2-r1), but all current in-tree ebuilds for open-vm-tools-kmod (0.0.20111026.514583, 2011.11.20.535097, fail to build against them. This means there's no safe upgrade path for users who are waiting for this bug to be resolved.

I also noticed that the ‘vmuser_fops’ error in vmci driver also happens when trying to compile the offical vmware modules from app-emulation/vmware-tools- (against hardened-sources-3.2.2-r1).

Finally, this bug was cross-reported on open-vm-tools bugtracker [1] almost 2 months ago without seeing any followup. Maybe we shouldn't be waiting for an upstream fix (are we?) but just fix the ebuilds in portage? Maintainer?

Comment 19 PaX Team 2012-02-04 12:06:40 UTC
open-vm-tools-kmod-2011.12.20.562307 compiles with 3.2.4/PaX and for vmware-modules-238 i've had a patch in my homedir since last september.
Comment 20 Richard Yao (RETIRED) gentoo-dev 2012-10-22 10:50:59 UTC
hardened-sources-3.0* is no longer in the tree. Closing obsolete.