Upvote:5
The visa expiry is not an issue. You can use the visa to enter up to and including the day the visa expires.
The passport expiry is an issue. If your passport is from this list of countries, the date you are admitted until as a nonimmigrant can be no later than the day your passport expires. If your passport is from a country not on that list, the date you are admitted until as a nonimmigrant can be no later than 6 months before passport expires (which means you cannot enter if your passport is less than 6 months away from expiring).
So either you will not even be able to travel to the US (if your passport is not on that list), or you will be able to enter but you will only be admitted until Oct 7 at the latest, not as long as you want (if your passport is on that list).