Failed to stop overwriting a running binary
runsc result:
$ stress -c 1 &
$ which stress
/usr/bin/stress
$ cp /bin/ls /usr/bin/stress
[1]+ Bus error stress -c 1
Expected result in vanilla Linux:
$ stress -c 1 &
$ which stress
/usr/bin/stress
$ cp /bin/ls /usr/bin/stress
cp: cannot create regular file '/usr/bin/stress': Text file busy
A friendly reminder that this issue had no activity for 120 days.
I can still repro this issue with latest runsc build.
I'd like to work on this. Right now linuxerr.ETXTBSY is defined but never actually returned anywhere — there's no write-tracking for executing files. My plan: mark a file as in-use when the loader opens it for exec (pkg/sentry/loader), and check that in the VFS open/truncate path, returning ETXTBSY on conflict, similar to how Linux ties this to i_writecount. I'll add a regression test under test/syscalls too. Mind assigning it to me?