The Gold Master of iOS 4 that was just released yesterday after Steve Jobs WWDC keynote has already been jailbroken by msft.guy. This was accomplished by using some hackery along with the Dev Teams's existing Pwnagetool.
The Dev Team has stated that they do have a working jailbreak for the final iOS 4 but we will not see that until June 21st or shortly there after so it may be wise to hold off on this particular hack. But if you are feeling brave and just have to jailbreak your iPhone 3GS running the iOS 4 GM then feel free to give it a try using these directions here.
Video after the break!