-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Porting the approach to a i9100? #2
Comments
You must obtain sboot.bin for this device. I never owned an i9100 but I guess it uses the same boot process, so there must be an sboot.bin somewhere. The firmware you downloaded probably did not intend to upgrade sboot, so just try to obtain something like a "stock" firmware. The |
It's a complete brick.
I have by now downloaded several versions of stock firmwares. Some contain |
So you must use an external SD card to load sboot. This is of course assuming that Exynos 4210 resorts to external SD card in case eMMC boot fails - otherwise, this method won't work. According to this link, it seems that ODROID also released a method for booting U-Boot on Exynos 4210, so this does look promising.
If I recall correctly, boot.bin is just the Linux kernel + initrd which is only used later in the boot process. Even though it sounds different, it resides in the eMMC's user partition (i.e. not in the boot partition). |
Nice!
Here you go, first
No S-Boot string in there... And
I'd interpret the strings as if "Pbl" from |
Hi! I have Samsung Galaxy Tab 7.7 P6800 which is complete brick too and has Exynos 4210 processor, like S2. And firmware for this device does not have sboot.bin too, just boot.bin and Sbl.bin like S2. For illustration here is content of XEU-P6800XXLQG-20130306101431.zip firmware for Tab 7.7 (it has Android 4.0.4).
New version of firmware (e.g. THL-P6800DXMD3-20130424182140.zip with Android 4.1.2) is missing two files boot.bin and param.lfs. I tried to use sboot.bin from S3 on my device but did not worked (nothing happened). It is expected that S2 and Tab 7.7 could use same bootloader binaries as they have same CPU? |
Some information what boot.bin and sbl.bin is can be found there: https://android.stackexchange.com/a/142423
|
Maybe this could help: Benjamin-Dobell/Heimdall#90 (comment) According to that dump from S3, sboot.bin is stored on partition BOOTLOADER starting at sector 0 with size 1734 bytes. Can be get a dump from working S2 device (or any other which use boot.bin & sbl.bin) to know which partition starts at sector 0 and which file is flashed there? |
As far as I remember (I've done this research some time ago already), the main issue with completely bricked I9100 devices was a lack of presigned BL1 Exynos4210.
In case of I9100, none of the above was available. We even asked Samsung if they could just sign a binary for us, but they refused. If nothing has changed, the 2 technical possibilities I see is either:
@olifre does your ROM enter the download mode? If you boot it up with USB connected, you should briefly see a new USB device appear. I think it only stays attached for couple of seconds, if no USB download is started on the PC side. PS: It is wonderful to see this project revived, @oranav! Congratulations on the CCC presentation. |
@dmarszk when I connect Samsung Galaxy Tab 7.7 P6800 (it has Exynos 4210 too) via USB to PC, there is no boot ROM device detected at USB bus. Nothing in dmesg. |
@pali Then it's likely it gets stuck somewhere after iROM execution, but before SBL (edit: there's no S-Boot) can initialize the download mode. The only way to trigger iROM fallback to other boot sources (including iROM download mode) in that case would be by preventing the SoC from accessing the eMMC. We have had success in doing just that by shorting one of the eMMC pull-up resistors with pliers during the device power-up. This, however, won't get you anywhere if you do not have a proper payload to upload. |
I dug out some brief notes from my research done on SGS2 family in 2011/2012, if you want to play with it.
SBL implements mostly the same download protocol (ODIN) as SGS1-3. AFAIR SGS3 was the first one to use S-Boot (essentially rewritten and renamed SBL). There are SecureBoot 2.0 data types that I think I took from Odroid U-boot: I also have some dumps. Let me know if you need them. |
Same here for the dead SGS2 I have. Completely "dead", i.e. neither USB jig does anything, nor do I see anything in dmesg. |
@dmarszk Gaining code execution on the 4210 iROM sounds like a fun and interesting project :-) Even though the attack surface is probably limited. I don't own an I9100 however, and I believe I won't have any spare time soon, but in any case - do you know if its iROM has been leaked somewhere? Maybe I'll take a look at the weekend or something like that. |
@oranav I dropped you an email with what I could dig up. |
@dmarszk Cool, thanks! |
I found some very interesting (and very recent) blog post - https://www.fredericb.info/2018/03/emulating-exynos-4210-bootrom-in-qemu.html |
From that description in blog it looks like it is needed to find collision in SHA1 for specified OTP key or breaking included RSA public key. Or rewrtie OTP memory. Any of those options do not seem to be easy... |
@pali This is actually worse - it's not a collision, but more like a second preimage ;) I think that without any code execution vulnerability this will be basically impossible, unless Samsung did something very stupid with their RSA key generation. |
Yes, preimage :-( Anyway, looking at it again and description of verification seems strange
How can be signedData generated if it is input for HMAC itself? |
rsaPubKey is given. Calculate HMAC using some constant predefined key: |
Ok, now I see it. Samsung first generated RSA key and signed with it bootloader (generated signedData) and after then it generated OTP key and wrote it into devices. (I was in impression that OTP key was there first...) If there is not any vulnerability for rewriting OTP memory it is really impossible to generate new valid signedData. |
sounds like we need to h4x0r iROM. on the verizon version of the Galaxy Note II, which I think is a slightly different Exynos SoC, there was a claim that people had an iROM exploit. dmarszk/exynos4_uboot#4 i wonder what their method was and if it can be reused on the i9100. |
There's some incredible work going on related to porting the i9300 and n7100 to uboot based on the iROM exploit that I linked to in April. https://blog.forkwhiletrue.me/ Does this work rise to the level of being worthy of being mentioned on the README of this project? |
@herbsmn: I guess that does not help with booting on i9100 with Exynos 4210. |
I am not sure the github issue tracker is the correct place, but at least this gives the idea a prominent place for others to chime in.
Are you aware of any effort to port the "repair approach" to the Galaxy S2?
It seems the bug, or at least its effects, are almost exactly the same, and Samsungs "Fix", judging from personal experience and complaints in forums, has also led to freezes for this device. Interestingly, the only "fix" I find online is to disable
MMC_CAP_ERASE
in the kernel.I have such a device with me here (which is "fully" bricked, i.e. also does not show sboot anymore),
but I'm not really up to replicate the full procedure (including re-creating the boot partition etc.)
and I also don't have good contacts to ask for the fixed firmware for the eMMC chip in this device.
For starters, I have downloaded a firmware release for S2, but sadly only found a
boot.bin
inside (notsboot.bin
), so I am unsure whether this is correct.Also, I'm not sure the
hardkernel
files can just be re-used for the device.Any pointers / hints to related projects are much appreciated.
The text was updated successfully, but these errors were encountered: