The water level in a
washing machine is determined by the pressure switch. The switch is located behind the load selector, water level, load size (has various names depending on model and manufacturer) knob on the operator
console. If the switch malfunctions, the water will not shut off and the washer will overflow.
Now...before assuming the switch is defective, a common problem that occurs is the small air hose on the pressure switch coming loose or leaking. This air hose attaches from the wash tub to the pressure switch. The pressure swtich senses the change in air pressure as the tub fills and shuts the water off at the selected level. The following link explains:
http://www.fixya.com/support/r762094-washer_overflowsTo access your pressure switch, unplug the washer and open the operator console. Look for a clear plastic hose. If it is NOT attached, you may have found your problem. Reconnect and test operate.
If it IS attached, check the entire length of the hose all the way to the wash tub for any cracks of leaks. In addition, remove the electrical connection(s) and check for corrosion. Clean if necessary.
If all these preliminary steps don't solve your problem, replace your pressure switch. Read through the link I provided and let me know if you have any questions. I hope you find this information helpful.