ioi / isolate

Sandbox for securely executing untrusted programs
Other
1.05k stars 157 forks source link

Fix: If call of execve fails, it is usually fault of the program being executed #98

Closed Neloop closed 2 years ago

Neloop commented 3 years ago

Hi, On a regular basis we run into issue described in #77. This PR changes error reporting of isolate when execve call fails, because it usually fails in case of problem with the sandboxed program. It would be really great to see this change in isolate upstream. Thanks!

Neloop commented 2 years ago

Hi @gollux, @bblackham any chance to get this into upstream isolate? Occasionally, we still encounter this problem and it would be nice to have this solved officially. Thanks!

gollux commented 2 years ago

Sorry for the delay.

This is a wrong fix, err() is really not expected to be called from the box process. Only die() knows the right magic to get internal errors out of the sandbox.

I just committed another solution, which just prints an error message to stderr and exits with status 127. This status is traditionally used by shells to signalize exec failure.

Neloop commented 2 years ago

Great! Thanks for the correct fix...