It appears that a hacker from Amsterdam by the name of Kaatje, has managed to create a custom firmware that allows iPhone 3GS users to jailbreak the newest iPhone OS 4.0 Beta 4.
The iPhone Dev team released Redsn0w 0.9.5 to jailbreak iPhone OS 4.0 Beta 4, however it was only compatible with the iPhone 3G. With Kaatje's work, we now have reports of a jailbroken 3GS running 4.0 Beta 4. And to top it off, she has managed to do so without upgrading the baseband, thus preserving the ability to unlock on blacksn0w if you wish to go back or stay on the safe side.
The method she describes requires a custom firmware using a patched PwnageTool. The patch will not work with the iPhone 3G, but thats what the current redsn0w release is for.
“I accomplished this by patching asr, lockdownd, LLB, iBEC, IBSS, iBoot, kernelcache, MobileSafari, Services.plist, and fstab. The binaries were patched with IDA Pro and OxED and were then diffed against the original pwned files with bsdiff to create patch files. I then took the diff files and built a firmware bundle that I dropped into Pwnagetool and updated the cydia tree within Pwnagetool as well. Once this was done, I created a custom ipsw with Pwnagetool, unzipped it, applied a pwned LLB from a pwnagetool generated 3.1.3 ipsw, zipped it back up and restored to my device.”
Note: She will NOT be releasing this custom firmware at this point due to prior agreements with the dev teams and of course for legal reasons and because they gave her many parts of the jailbreak.