onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

The EP_CTX_BLOB seems to have both WRITE and EXECUTABLE permissions enabled

Open vthaniel opened this issue 1 year ago • 1 comments

Describe the issue

The EP_CTX_BLOB (The compiled model saved as an ONNX blob on the disk) seems to have WRITE and EXECUTABLE permissions enabled. Since a compiled blob is meant to be read from, I think only READ permissions are sufficient.

To reproduce

Use the following Session Configuration to save the EP context blob on the disk

sessionOptions.AddConfigEntry(kOrtSessionOptionEpContextEnable, "1");

Then check the permissions enabled on the saved file

Urgency

No response

Platform

Windows

OS Version

Windows 11

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

https://github.com/microsoft/onnxruntime/tree/rel-1.19.0

ONNX Runtime API

C++

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

vthaniel avatar Oct 15 '24 04:10 vthaniel

On Windows does it matter?

snnn avatar Oct 15 '24 17:10 snnn

Hello IMHO it would be better not to have executable permissions (unless there is a reason) In Linux the same file does not seem to have executable permission. It comes as follows rw-rw-r--

vthaniel avatar Oct 29 '24 06:10 vthaniel

On Linux it is controlled by umask. It depends on how the user setting was set. I think it should not be part of ONNX Runtime's logic. We should just rely on the operating system's default. Windows's permission model is quite different. I think executable permission bit is not very useful.

snnn avatar Oct 29 '24 18:10 snnn

Applying stale label due to no activity in 30 days

Applying stale label due to no activity in 30 days