Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/46547 )
Change subject: it85spi.c: Kill off dead code system() hack ......................................................................
Patch Set 1:
Patch Set 1: Code-Review+2
While the driver is called IT8502E, it is talking to a very specific version of the EC firmware that was running on a very specific set of machines that used to have this chip.
Chances are that none of these machines are in operation anymore, and if they are, they are most likely no longer relevant. But that goes for a lot of the code in coreboot / flashrom et all.
Angel, chances are also, that your behavior is caused by one of two things happening:
- the CPU is catching IO writes to the IO ports in question and, because flashrom does not pass the consistency checks for these accesses, an SMI reboots the machine.
It doesn't reboot the machine, it just powers off.
- the IT8502 firmware on your machine gets a command that it does not understand, because it's not running the firmware from the same ODM as the IT8502 that this driver was developed against, and the EC decides that because someone is sending potentially evil commands, the EC pulls the AP's reset line to stop the behavior. In a lot of these older systems there is no actual security strategy in the software design, and so the only way to keep the device safe is by obscurity. To prevent people from reverse engineering the project, rate limiting the access through resets is a somewhat reasonable method (hu hu).
I doubt the firmware on that device has any consideration w.r.t. security. I still need to look at it more closely, but I'm getting buried under more and more computers.
I bet that we could remove the it85spi driver from flashrom all together and no person or entity would actually ever care. Of course we might want to decide against it for educational reasons.
If anything, we would need to ensure we're only trying to use the code on whitelisted machines. Currently, there's no whitelist and the call to the it85spi code is commented-out, sooo... it doesn't make a difference. It's still being build-tested, though, so it's not as rotten as it could be.