Project

General

Profile

BootloadersFreedom » History » Version 64

Denis 'GNUtoo' Carikli, 03/29/2020 12:21 AM

1 1 Denis 'GNUtoo' Carikli
h1. Bootloaders
2
3 40 Denis 'GNUtoo' Carikli
h2. Introduction
4
5 59 Denis 'GNUtoo' Carikli
In order to run free software bootloaders, we need the ability to run the code we want at boot. However in most smartphones and many tablets use code signature at boot, which prevent us to run free software bootloader.
6 40 Denis 'GNUtoo' Carikli
7 59 Denis 'GNUtoo' Carikli
This usually works by hardcoding the hash of a public key either in the rom code that loads the bootloader, or in one time programmable fuses that are then used by the rom code to check the bootloader.
8 1 Denis 'GNUtoo' Carikli
9 59 Denis 'GNUtoo' Carikli
If the signature don't match, the bootloader is not executed, so the device can't boot.
10
11 40 Denis 'GNUtoo' Carikli
In practice:
12
* Some system on a chip either don't implement code signature or the implementation is not used or tested.
13 1 Denis 'GNUtoo' Carikli
* For some other system on a chip, it's up to the device vendor to choose to implement code signature or not.
14 40 Denis 'GNUtoo' Carikli
* For some system on a chip, we don't know any devices not enforcing code signature, but we don't know who decided to enforce the code signature.
15 59 Denis 'GNUtoo' Carikli
* Some device vendors might use default key that are part of the software to sign bootloaders.
16 1 Denis 'GNUtoo' Carikli
17
h2. Devices configurations
18
19 59 Denis 'GNUtoo' Carikli
|_. Device and documentation |_. Bootloader freedom situation |_. Boot order |
20 52 Denis 'GNUtoo' Carikli
| [[NexusSI902xBootloader| Samsung Nexus S (GT-I902x)]] | Proprietary, Signed on the tested devices | ?->USB->?->eMMC->? |
21 57 Denis 'GNUtoo' Carikli
| [[I9100Bootloader| Samsung Galaxy S2 (GT-I9100)]] | Proprietary, probably Signed | ? |
22 59 Denis 'GNUtoo' Carikli
| [[I9100GBootloader| Samsung Galaxy S2 (GT-I9100G)]] | Signed on some devices
23
                                                        No unsigned devices found yet | ? |
24 52 Denis 'GNUtoo' Carikli
| [[GalaxyTab2Bootloader| Samsung Galaxy Tab 2]] | Proprietary, signed | ?->USB->?->eMMC->? |
25 59 Denis 'GNUtoo' Carikli
| [[OptimusBlackBootloader| LG Optimus black (p970)]] | Unsigned, can be replaced with upstream u-boot | eMMC(MMC2)->USB |
26 39 Denis 'GNUtoo' Carikli
| Galaxy SIII (I9300)
27 10 Denis 'GNUtoo' Carikli
Galaxy SIII 4G (I9305)
28
Galaxy Note II (N7100)
29 39 Denis 'GNUtoo' Carikli
Galaxy Note II 4G (N7105) | * Proprietary, Signed
30 59 Denis 'GNUtoo' Carikli
* There is work in progress to understand if we can avoid bypass the signature checks | ?->eMMC->?->USB->? |
31
| Golden Delicous GTA04 | Unsigned, free software | * Aux not pressed during boot: ?
32 1 Denis 'GNUtoo' Carikli
* Aux pressed during boot: ?->SD->?->NAND
33
SYS_BOOT0 = 1
34
SYS_BOOT1 = 1
35
SYS_BOOT2 = 1
36
SYS_BOOT3 = 1
37 31 Denis 'GNUtoo' Carikli
SYS_BOOT4 = 1
38
SYS_BOOT5 = AUX button
39
SYS_BOOT6 = 1 
40 52 Denis 'GNUtoo' Carikli
But cannot find Reference manual for the DM370 |
41 59 Denis 'GNUtoo' Carikli
| Pinephone | Unsigned free software | |
42 52 Denis 'GNUtoo' Carikli
| Librem5 | Unsigned bootloader, nonfree DDR4 controller firmware | |
43 1 Denis 'GNUtoo' Carikli
44 53 Denis 'GNUtoo' Carikli
Other devices with free software and unsigned bootloaders:
45
* Openmoko GTA01 and GTA02: cannot run Replicant (only has 128M of RAM, armv4t).
46
* Many single board computers: They are not very practical to use as a smartphone or tablet, though they could be added along the way to Replicant 9 if there is some interest
47 1 Denis 'GNUtoo' Carikli
* Older PDA like the OMAP4 Blaze: Check if they can *easily* be found: they were very expensive. Also check the upstream status. See [[TargetsEvaluation]] for such devices.
48
49
Other:
50 53 Denis 'GNUtoo' Carikli
* Optimus 3D: There is probably a leaked key for signing the bootloader
51
* [[FindDevicesWithUnsignedBootloaedrs]]: Project to find devices with free software bootloader at a very large scale
52
53 50 Denis 'GNUtoo' Carikli
h2. System on a chip
54 36 Denis 'GNUtoo' Carikli
55 8 Denis 'GNUtoo' Carikli
|_. SOC and documentation |_. Freedom situation |
56 33 Denis 'GNUtoo' Carikli
| [[OMAPBootrom|OMAP]] | * No known bug
57 59 Denis 'GNUtoo' Carikli
* Some devices are not signed
58
* Undocumented? (probably a very good sign if it's the case) |
59 38 Denis 'GNUtoo' Carikli
| [[Exynos4Bootrom|Exynos 4]] | * Some or all devices are signed
60 1 Denis 'GNUtoo' Carikli
* work in progress to understand if it's possible to bypass the signature |
61
| [[BroadcomVideoCore]] | The SOCs have the ability to check signatures |
62 42 Denis 'GNUtoo' Carikli
| [[TegraBootrom]] | * Not all devices use code signature
63
* Boot from USB is possible thanks to "fusee_gelee":https://github.com/Qyriad/fusee-launcher/blob/master/report/fusee_gelee.md
64 43 Denis 'GNUtoo' Carikli
* Code can be appended to the bootrom by writing in a fuse area. Could that be used to disable code signature ? |
65 39 Denis 'GNUtoo' Carikli
| IMX 5 and 6 | * Not all devices are signed
66
* Thanks to "Ref_QBVR2017-0001.txt":https://github.com/f-secure-foundry/usbarmory/blob/master/software/secure_boot/Security_Advisory-Ref_QBVR2017-0001.txt it's possible to bypass signatures anyway, and maybe load code through USB too |
67 33 Denis 'GNUtoo' Carikli
68 54 Denis 'GNUtoo' Carikli
h2. Tools
69
70 55 Denis 'GNUtoo' Carikli
Some of the tools below can also be used to find devices that don't have restricted boot.
71
72 54 Denis 'GNUtoo' Carikli
|_. Tool |_. Uses |_. supported hardware |_. Pakckages | Howto |
73
| "omap-usb-boot":https://git.replicant.us/contrib/PaulK/omap-usb-boot/ | * checking if the device is has restricted boot
74
                  * Loading bootloaders from USB
75
                  * booting on a different boot media | OMAP3, OMAP4, OMAP5 | "Parabola":https://www.parabola.nu/packages/pcr/x86_64/omap-usb-boot/ , "Archlinux through AUR":https://aur.archlinux.org/packages/omap-usb-boot/ | * [[FindOMAPDevicesWithUnsignedBootloderFromUSB| check if the device has restricted boot through USB]] |
76
| "omap-u-boot-utils":https://nmenon.github.io/omap-u-boot-utils/ | * Loading bootloaders from USB
77
                      * Loading bootloaders from the UART | OMAP3, OMAP4 | "Parabola":https://www.parabola.nu/packages/pcr/x86_64/omap-u-boot-utils-git/ , "Archlinux through AUR":https://aur.archlinux.org/packages/omap-u-boot-utils-git/ | ? |
78
| "crucible":https://github.com/f-secure-foundry/crucible | * checking fuses settings | i.MX53, i.MX6DL, i.MX6DQ, i.MX6SL, i.MX6SLL, i.MX6SX, i.MX6UL, i.MX6ULL, i.MX6ULZ, i.MX7D, i.MX7ULP | TODO | TODO |
79
| "cbootimage":http://http.download.nvidia.com/tegra-public-appnotes/bct-overview.html | * Generate images
80
               * Dump images (including signatures?) | Tegra ? | "Parabola":https://www.parabola.nu/packages/libre/x86_64/cbootimage/ , "Archlinux through AUR":https://aur.archlinux.org/packages/cbootimage/ |
81
| "tegrarcm":https://github.com/NVIDIA/tegrarcm | * Load bootloaders from USB | Tegra ? | TODO | TODO |
82
| "0xFFFF":https://github.com/pali/0xFFFF | * Load signed bootloaders (-c) from USB | OMAP3430 and OMAP3630
83
                                                                                      Might be easy to add more OMAP3 by just commenting code in cold-flash.c | TODO, patch for libusb1 | TODO |
84 61 Denis 'GNUtoo' Carikli
| "sunxi-tools":https://github.com/linux-sunxi/sunxi-tools | ? | Allwinner SOCs? | "Parabola":https://www.parabola.nu/packages/community/x86_64/sunxi-tools/, "Archlinux":https://www.archlinux.org/packages/community/x86_64/sunxi-tools/ | TODO |
85 62 Denis 'GNUtoo' Carikli
| "ifdtool":https://review.coreboot.org/cgit/coreboot.git/tree/util/ifdtool | * Check if there is a Management Engine firmware | Intel x86 | ? | ? |
86
| "intelmetool":https://review.coreboot.org/cgit/coreboot.git/tree/util/intelmetool | * Check if there is a Management Engine firmware, check if the BIOS region is signed (Bootguard) | Intel x86 | ? | ? |
87 54 Denis 'GNUtoo' Carikli
88 63 Denis 'GNUtoo' Carikli
TODO:
89
* Add various I.MX tools
90 64 Denis 'GNUtoo' Carikli
* Add various u-boot and/or Barebox tools
91
* Add Exynos tools (mk4412 or similar)
92 63 Denis 'GNUtoo' Carikli
93 41 Denis 'GNUtoo' Carikli
h2. Links to cathegorize:
94 15 Denis 'GNUtoo' Carikli
95 25 Denis 'GNUtoo' Carikli
* https://www.theiphonewiki.com/ has a list of "Bootrom security issues":https://www.theiphonewiki.com/wiki/Bootrom for apple devices.
96 26 Denis 'GNUtoo' Carikli
* "Ti Nspire":https://hackspire.org ? RSA exponent issues?
97 10 Denis 'GNUtoo' Carikli
98 9 Denis 'GNUtoo' Carikli
== See also ==
99 8 Denis 'GNUtoo' Carikli
100
* [[Upstream]]