Your landlord may actually have proactively taken action to protect your rights, and his position. By having an executed bonafide lease in place, his lender may very well be disinclined to take sudden and aggressive action against him in foreclosure, and may be more apt to consider a work out program to avoid foreclosure. Since the bank would have to take your home back, subject to your lease, and therefore would have to either hold the home - possibly using a court appointed receiver for the rents, or at the minimum, incur additional costs and liability for managing a rental vs a vacant house - or barring that would have to sell to an investor for significantly less than fair market value in order to find someone willing to take the risk of eviction on - the bank has far more incentive to work with your landord.
I suggest that you speak to your landlord. Consider the possiblity that he is actually helping you, and see if you can be a good team here to help both of your causes.
The best answer for legal issues would be an real estate attonrey.
First Weber Group
Certified Distressed Property Expert
I personally don't think that it is quite that "cut and dry", and that there are some other possible conclusions, but I wouldn't presume to give legal advice on such a matter.
Either way you are protected by the new Tenant Law which states that your Lease has to be honored. If the house is foreclosed on and someone knocks on your door as the new owner or their representative just keep a copy of your lease handy to give them and they will be your new property manager. They must honor your lease if it is bonafide and in writing.
Didn't we answer this already? In addition to my previous answer in the link below, you should contact an attorney.
Broker / REALTOR
"Moving Lives Forward"