Don't forget, though, the Geth pretty much defended themselves without even having time to understand what was happening.
Imagine suddenly gaining both sentience and awareness, and the first thing which your creators and masters do is try to destroy you.
To drive this home even further, even the "evil" Geth who sided with the Reapers were essentially indoctrinated themselves. In ME2, Legion basically overwrites corrupted files with stable/baseline versions.