If you have recently connected your iPhone or iPad to iTunes you will have been greeted with an update message, earlier today Apple updated iOS to 4.0.2 for the iPhone (and iPod touch) and iOS 3.2.2 for the iPad. The updates patch a security vulnerability that allowed Safari to run code embedded in PDF files.
The updates are available through iTunes. Click “Check for Update” to download. If you are on a slow connection however you might want to reserve some time as the updates are HUGE, the iPhone update is 580MB in size and the iPad update is 457MB.
If you have a plan of jailbreaking the iOS through JailbreakMe.com, then you might want to hold off on the update. as the new iOS removes this possibility as it exploited the vulnerability seen in the previous software.
If you are interested in more details then read these articles directly from Apple: