Open Quuxplusone opened 14 years ago
Bugzilla Link | PR6701 |
Status | NEW |
Importance | P normal |
Reported by | Török Edwin (edwin+bugs@etorok.eu) |
Reported on | 2010-03-25 09:39:01 -0700 |
Last modified on | 2016-01-26 10:08:23 -0800 |
Version | unspecified |
Hardware | PC Linux |
CC | hfinkel@anl.gov, llvm-bugs@lists.llvm.org, michael@loeffler.io, pitrou@free.fr, rafael@espindo.la |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Unfortunately the address of those 2 mapping will be different, so relocations/and absolute address emission will need to be done with the executable mapping, and actually writing the code on the writable mapping.
On a second thought that workaround for SELinux sounds silly, and I don't think it adds any security.
We shouldn't crash though, but tell user to turn 'execmem' off.
FWIW on fc13-alpha a message is printed that allocation of RWX memory failed,
and lli fails to work.
This happens when FC13 is run in enforcing mode (the default).
(In reply to comment #3)
> We shouldn't crash though, but tell user to turn 'execmem' off.
r99762 should fix the crash.
Hmm, instead of the 2 buffer approach, we could initially allocate a memory that is only writable, and then later we change it to executable only.
I see that something similar is already done for ARM with setRangeWritable(..), setRangeExecutable(...). This should be generalized to all JIT targets.
We could do this at least in eager JIT mode, since we shouldn't need self-modifying stubs then.
Hello,
r99762 should fix the crash.
It seems that change is unfortunately obsolete. A Numba user reported a crash with SELinux enabled: https://github.com/numba/numba/issues/1288
I don't have a SELinux-enabled machine at hand, but by digging a bit it seems the error probably happens in sys::Memory::protectMappedMemory(), called from SectionMemoryManager::applyMemoryGroupPermissions(), called from SectionMemoryManager::finalizeMemory(), called from ObjectLinkingLayer::finalize() where the error return is ignored.
Note this is on master. On 3.6, the same problem happens in MCJIT::finalizeLoadedModules() which ignores LinkingMemoryManager::finalizeMemory()'s error return.
It would be nice to reenable the check and subsequent error message.
I'm the numba user, to whom Antoine was referring. To help getting this bug fix, I just placed a bugbounty of 250$ on getting this fixed in a way, so that numba plays nicely together with selinux.
https://www.bountysource.com/issues/29603275-doesn-t-work-with-selinux