Bug 79924 - LibreOffice should use stemp in other directories than $HOME first
Summary: LibreOffice should use stemp in other directories than $HOME first
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
(earliest affected)
Hardware: Other All
: medium normal
Assignee: Not Assigned
Keywords: skillCpp
Depends on:
Reported: 2014-06-11 17:51 UTC by Alban Crequy
Modified: 2016-11-08 12:53 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Alban Crequy 2014-06-11 17:51:35 UTC
Libre Office double mmaps a temporary file to build trampolines block. It attempts to create the temporary file in $HOME, and fallbacks on /tmp:

236	#ifdef USE_DOUBLE_MMAP
237	bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const

But $HOME is more likely to be noexec, so it is better to try /tmp first. Using $HOME first can also create annoying complains in LSM such as SELinux or AppArmor.

As an example, libffi tries the following directories, in this order, until it finds something suitable:
2. /tmp,
3. /var/tmp,
4. /dev/shm,
5. $HOME,
6. whatever is listed in /etc/mtab,
7. whatever is listed in /proc/mounts

See https://github.com/atgreen/libffi/blob/master/src/closures.c#L382
Comment 1 Michael Meeks 2014-06-11 17:59:16 UTC
T'was Caolan who first told me of the existence of this magic =)
Comment 2 Caolán McNamara 2014-06-12 09:59:00 UTC
I just used /home falling back to /tmp because Ulrich indicated that the temp dirs were more likely to have noexec set (http://www.akkadia.org/drepper/selinux-mem.html)

Should be fairly easy to adapt the code to look in more places and reorder the places it checks, I've no problem with applying any patch that does that. Not on my own current radar to do it though, so I'll set the easyhack flags
Comment 3 Robinson Tryon (qubit) 2015-12-13 10:58:00 UTC Comment hidden (obsolete)
Comment 4 Stephan Bergmann 2016-01-18 15:03:28 UTC
note that the likelihood of actually executing the double-mmap code paths severely decreased with <http://cgit.freedesktop.org/libreoffice/core/commit/?id=8b9968a26265facaf5e761485d750ce9cedab3ab> "fdo#72755: Only use double mmap as fallback"
Comment 5 jani 2016-02-11 13:05:32 UTC
No code pointer
Comment 6 Robinson Tryon (qubit) 2016-02-18 14:52:13 UTC Comment hidden (obsolete)
Comment 7 Xisco Faulí 2016-10-10 11:24:33 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2016-11-08 12:53:52 UTC
Dear Bug Submitter,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team