← Back to context

Comment by dale_glass

5 years ago

A couple things I wonder there:

How does Robin (id1) manage to print the "I am under attack" message? Shouldn't a kill be immediate?

Couldn't they just do something like sending a SIGSTOP to processes, or use killall in a tight loop? I get it's not Unix, but it seems reasonable similar concepts should exist.

Also, this is more in line with Ken Thompson's "Reflections on Trusting Trust"

You can put a signal handler in your program to catch the SIGSTOP and run some code before it gets killed.

  • You can't catch SIGSTOP or SIGKILL. If you're trying to eliminate a rogue process, you wouldn't as nice as to ask it to politely shut down. It could just refuse. So if you're killing it forcefully, it shouldn't get to print anything. If you're asking it politely, then it can just refuse to die and doesn't need a monitor process to restart it.

    In this story this isn't Unix but I imagine the same should apply. If you're trying to terminate something with extreme prejudice, it shouldn't get any chance to print anything.

    • Can't catch those signals, but under a very specific sets of circumstances, they could be... not quite ignored, but basically, that is behavior.

      Things which are pending completion of I/O won't die as soon as SIGTERM or SIGKILL are sent to them. If you have ever tried to kill a process which had open file handles on a stale NFS mount, you have experienced this behavior. Causing it to happen deliberately is a lot more challenging, as well as not having a process actually be BLOCKED due to I/O, but it was[1] doable.

      [1] haven't tried to do this in about a decade, so won't speak about the currency of this approach, but back then, with some clever assembly and a kernel module, it was doable.