tum-ei-eda / etiss

Extendable Translating Instruction Set Simulator
https://tum-ei-eda.github.io/etiss/
Other
29 stars 36 forks source link

Support TCC JIT engine on systems with SELinux enabled #91

Closed lukasauer closed 2 years ago

lukasauer commented 3 years ago

By default, TCC does not support running on systems with selinux set to enforcing. Running ETISS leads to the following run-time error in this case.

tcc: error: mprotect failed: did you mean to configure --with-selinux?

Fortunately, this already gives us the solution to the problem, TCC just has to be configured differently in JITImpl/TCC/CMakeLists.txt. Now the question is, how this should be handled within the ETISS build system. I already briefly discussed this with @JoGei and we came up with three possibilities.

  1. Automatically detect selinux within cmake. This could be done by checking if the binary getenforce exists and returns Enforcing.
  2. Add a cmake variable (for example ETISS_SELINUX), which the user has to set accordingly.
  3. Always enable selinux support in TCC. This works, but may lead to a performance overhead.

I am not sure what the best approach would be here, option 1 would definitely be the most user-friendly one.

rafzi commented 3 years ago

Thanks for bringing this up!

3) should be avoided without an evaluation. 2) seems like a quick and easy fix. 1) seems nicer, but of course more effort.

So 1) or 2) would be welcome changes if you could propose them please.

lukasauer commented 3 years ago

Sounds good, I will look into it, but probably won't have time to this week.