pranavappu007 wrote:I was wondering why all the protection systems has to be hardware based. Why even run user binary directly on CPU? Even old systems in 70s ran interpreters like BASIC,with the exponentially faster CPU and other peripherals, now we can't afford the overhead of an interpreter? Even android apps are running on top of a Java VM.
Part of the answer is that we're doing harder things with software now, that the old 70s/80s home computers didn't have the performance to handle on bare metal, let alone an interpreter. No matter how fast your CPU is, there will always be some problems that it's too slow for, and so interpreter overhead will always sacrifice *something*.
Another other part of the answer is that, when we aren't doing those things, we can afford the overhead of *many* interpreters. Running on my system right now, I count 1 instance of bash, 1 of java, 3 of make, 1 of python, 3 of plain old sh, and 6 of zsh. Plus, IIRC, most of my Desktop Environment is written in python, so there's probably a heap of different python interpreters running that don't have the process name "python".
And then there's the fact that a buggy interpreter can always be tricked, but, interpreted or not, if each process has its own address space, then the data of other processes doesn't even *exist* as far as that process is concerned. Admittedly, you can have kernel or CPU bugs that degrade this protection, but putting an interpreted process in its own address space prevents it from getting unauthorized access simply by exploiting an interpreter bug. There needs to be a follow up to the attack on the interpeter bug that attacks the kernel or CPU.