-
Notifications
You must be signed in to change notification settings - Fork 394
Description
Currently, the Miri interpreter only allows one kind of communication between the executed program and the outside world: printing to stdout/stderr. In the long run, that will not be enough. There were already requests for access to the system time, and it seems reasonable to ask for file system or network access. Getting proper randomness into the program might also be interesting.
This issue is basically the current status of #653, now that we [soon will] have a deterministically seeded RNG available in Miri all the time -- so much of the discussion there no longer applies.
It probably makes sense to allow external communication per default, just to get more programs running. But isolation is also a useful property, so I propose a -Zmiri-isolate
flag to "turn off" external communication.
Assuming that's not very controversial, we have to decide what to do with the two existing systems we have in place that try hard to avoid allowing external communication:
- Environment variables. Should we just forward setting/getting env vars to the outside OS per default, and only keep using our current env var emulation layer when
-Zmiri-isolate
is set? That would resolve Support for accessing host environment variables #670. getrandom
. Should we just ask the OS for "real" randomness per default, and only ask our internal RNG when-Zmiri-isolate
is set?
Current status
- Add off-by-default "external communication" mode. Tentative name of the flag: ´-Zmiri-enable-communication.
- Allow interpreted program to access host env vars if external communication is enabled.
- Allow interpreted program to access host randomness if external communication is enabled.
- Come up with a less clumsy name for the flag that enables communication. Maybe
-Zmiri-disable-isolation
? Is that really less clumsy?-Zmiri-no-isolate
? - Turn external communication on by default?