Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared Library noexecstack flag #2880

Closed
yuzawa-san opened this issue Jan 21, 2020 · 3 comments · Fixed by #2911
Closed

Shared Library noexecstack flag #2880

yuzawa-san opened this issue Jan 21, 2020 · 3 comments · Fixed by #2911
Labels
feature request request for unsupported feature or enhancement

Comments

@yuzawa-san
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The onnxruntime shared library is linked without -z noexecstack flag, so the stack is executable as a result. This triggers security warnings specifically when using the Java API, as the JVM's loader emits a warning (but does not outright prevent the loading of the library). Here is an example of what type of warning the JVM makes #2215 (comment)
My environment creates an identical warning.

System information

  • ONNX Runtime version (you are using): 1.1.0
  • Os: ubuntu linux, but should be reproducible in most linux distros

Describe the solution you'd like
I played around with adding -z noexecstack to end of https://github.com/microsoft/onnxruntime/blob/master/cmake/onnxruntime.cmake#L42 and it seemed to work. However I am not a day to day C/C++ dev, so I do not know the implications of this.

Describe alternatives you've considered
https://wiki.ubuntu.com/SecurityTeam/Roadmap/ExecutableStacks seems to discuss marking inline assembly manually. Once again, I do not know the implications or best practices for this, so I think this issue is a good place to discuss possible solutions.

@yuzawa-san
Copy link
Contributor Author

@Craigacp was the original Java API developer and found this first.

@Craigacp
Copy link
Contributor

In my testing everything also appeared to work just fine without an executable stack, though I tried it by setting the flag on the built so file, rather than by changing the CMake flags.

@snnn
Copy link
Member

snnn commented Jan 21, 2020

Good suggestion. We'll do it.

@faxu faxu added the feature request request for unsupported feature or enhancement label Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request request for unsupported feature or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants