FS#55954 - [wine] 32 bit wine: error while loading shared libraries: out of memory: Operation not permitted

Attached to Project: Community Packages
Opened by Owen Barton (grugnog) - Wednesday, 11 October 2017, 17:37 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 12 May 2018, 01:06 GMT
Task Type Bug Report
Category Packages: Multilib
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Felix Yan (felixonmars)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

32 bit wine fails with the message "/usr/bin/wine: error while loading shared libraries: out of memory: Operation not permitted" when starting any windows program. winecfg also fails with the same error.

64 bit wine functions correctly.

Additional info:
* package version(s)

wine-2.18-2-x86_64
$ wine --version
wine-2.18

* config and/or log files etc.

This occurs with a freshly created user account, so is not related to user environment or .wine directory permissions etc. There are no configuration files or wine related environment present.

I have also tried reinstalling wine and all dependencies (as well as optional dependencies). I tried rolling back wine and several of the dependencies but was not able to resolve the issue and narrow down the change that caused the issue (I may try this further if I have time). Rolling back wine itself does not appear to resolve the issue however.

I also noted that running 32 bit wine as root does work (don't run it as sudo of course, because that will change .wine ownership). Looking at the library file permissions they appear correct.

Running it with strace it appears the main issue is with /usr/bin/wine-preloader loading libwine in preparation for running wine itself - see attached strace log.

Steps to reproduce:
* Create new test user and login as test user
* Run "wine cmd.exe" - observe error
* Run "winecfg" - observe error

Expected behavior (with wine64):
* Create new test user and login as test user
* Run "wine cmd.exe"

$ wine64 cmd.exe

wine: created the configuration directory '/home/testuser/.wine'
...
wine: configuration in '/home/testuser/.wine' has been updated.
Microsoft Windows 6.1.7601 (2.18)

Z:\home\testuser>
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Saturday, 12 May 2018, 01:06 GMT
Reason for closing:  Upstream
Additional comments about closing:  I don't think there is a reason to track this any longer in this tracker. It appears to be an upstream bug that only appears to a handful of users. Documenting this on the wiki would likely give this a better visibility to affected users.
Comment by Bjoern Bidar (Thaodan) - Friday, 03 November 2017, 01:26 GMT
Having the same issue.
Filled a bug entry at winehq:
https://bugs.winehq.org/show_bug.cgi?id=43963
Comment by Owen Barton (grugnog) - Wednesday, 08 November 2017, 23:05 GMT
This issue appears to be the same as https://wiki.winehq.org/Preloader_Page_Zero_Problem - running "$ sudo sysctl -w vm.mmap_min_addr=0" fixes the issue for me. Discovered this thanks to forum https://bbs.archlinux.org/viewtopic.php?id=231049

I am unclear if just adding this sysctl configuration to the package is the best solution - the issues linked from the wiki page seem to suggest this is still the only functional approach. It's strange that this was working previously though?
Comment by Bjoern Bidar (Thaodan) - Wednesday, 08 November 2017, 23:19 GMT
Sounds like an overkill to me, are there any side effects on this?
Comment by Owen Barton (grugnog) - Wednesday, 08 November 2017, 23:38 GMT
Yeah - it's clearly not ideal security wise since it opens up an old local-root exploit. I have had a look through other bugs though and can't find a change that caused this, since that may explain the rationale for this (and perhaps how it worked previously).
Comment by Sven-Hendrik Haase (Svenstaro) - Friday, 01 December 2017, 12:34 GMT
No idea why this would spontaneously arise. I do not want to add sysctl configurations for wine users as that would likely result in more weird problems. I think this should be fixed with a wiki note. Would anyone go ahead and add a note to the wiki for this?
Comment by Bjoern Bidar (Thaodan) - Friday, 01 December 2017, 12:45 GMT
Maybe a note with a workaround but even this workaround isn't that good.
Comment by Alexandre Julliard (julliard) - Thursday, 21 December 2017, 08:44 GMT
The page zero problem shouldn't prevent Wine from running. It looks like a bug in the kernel page zero check. From the log:

mmap2(NULL, 65536, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = -1 EPERM (Operation not permitted)

This one is the page zero allocation, it's OK for it to fail.

mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EPERM (Operation not permitted)

This one is a normal memory allocation, there's no MAP_FIXED so it shouldn't fail.
Comment by Bjoern Bidar (Thaodan) - Saturday, 23 December 2017, 14:17 GMT
Could you report this to the kernel bugtracker and maybe add this explanation to the wine bug tracker?
Comment by Bjoern Bidar (Thaodan) - Saturday, 23 December 2017, 14:19 GMT
Also this bug is still present in Linux 4.14.7
Comment by Bjoern Bidar (Thaodan) - Friday, 05 January 2018, 02:26 GMT

Loading...