Your passport must be valid for the duration of your stay. There is no "6 month rule".
Keep in mind as well, if you have a month or less left on your passport it is a good idea to renew it. In Canada it takes 10 business days to renew, in the US it takes far longer if I am not mistaken. Either way you are good BUT you might have tighter scrutiny on your passport if it has a month or less left on it.
Better safe than sorry.
No passport is valid beyond it expiration date. Some countries require that it must be 3-6 months before the passport expire.
This page is pretty clear. “Valid passport”