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 http://forums.gentoo.org/viewtopic-p-6837656.html
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.
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.
Created attachment 289513 [details]
Created attachment 289515 [details]
Output of `emerge --info`.
I'm experiencing the same problem (author of the post on the forums).
I can also confirm this happens.
This appens here too on x86 and amd64. I even tried open-vm-tools-kmod-0.0.20110923.491607 that gave the same errors.
Created attachment 289757 [details, diff]
vmci driver.c patch
Does static initialization of vmuser_fops structure.
Created attachment 289759 [details]
Ebuild to apply vmci-driver.patch
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.
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.
Can someone please get the fixes upstream? This bug report is still listed as UNCONFIRMED as well for some reason?
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.
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?
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.
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.
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.
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.
(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...
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, 22.214.171.1248969) 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-126.96.36.1998992 (against hardened-sources-3.2.2-r1).
Finally, this bug was cross-reported on open-vm-tools bugtracker  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?
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.
hardened-sources-3.0* is no longer in the tree. Closing obsolete.