Suppose I'm working on a computer and write a C program which invokes undefined behaviour. Since anything may have occurred, a (perhaps paranoid view) would be that anything the computer does thereafter is no longer trustworthy. For example, it may have rewritten the compiler, or modified the clock. Is it possible to restore the computer to a trustworthy state? Do any data security standards require action after a (trusted) user invokes undefined behaviour (from known code)?
My understanding is that (a) it's not uncommon for developers to occasionally write such bugs and (b) no action is ever required in practice. But I have not worked in an environment where a very high level of trust is required.
My guess is that if any action is required it would depend on the following factors.
- The sensitivity/value of the work being done on the computer (i.e. maybe worth it for top secret, or if the computer is going to space)
- Whether the code which invoked UB is known or not (e.g, even if the code can be identified, but the actual inputs are lost), or what type of bug was actually invoked
- The compiler and operating system used at the time.
And of course the cost of the action necessary to restore it a trustworthy state. Obviously I'm assuming that the computer was in a "sufficiently trustworthy" state beforehand.