ModemIsolationResearch » History » Revision 42
h1. Modem shared memory This section documents in more details the architecture of system on a chip and devices that have shared memory between the modem and the processor running Android. Since the modem runs (only) proprietary software, devices that doesn't have any mechanism that prevent the modem from taking control of the processor running Android are a grave concern for users freedom ans security. This section focuses on that issue. Some Qualcomm System On a Chip that are affected by this issue also have other issues that aren't mentioned here but in [[Qualcomm_SOCs|the Qualcomm System On a Chip page]]. Documenting the issue more in depth might allow us to understand if some devices with shared memory between the modem and the processor running Android might be able to be used safely. h2. Requirements Having the modem and the processor running Android in separate chip, connected through a bus (like USB) that doesn't allow the modem to access the Android processor's memory offers pretty good guarantee that the modem cannot take the control of the processor running Android at a hardware level. When the modem and the Android processor are in the same chip or when they use shared memory to communicate, and that memory is also used by the processor operating system, such guarantees are gone. Several hardware mechanism that can bring them back exist: * Some smartphones manufacturer could connect the modem to the processor running Android with separate dedicated memory that is not used for things other than enabling them to communicate. * IOMMUs are hardware dedicated to prevent peripherals (like a modem) from taking control of the processor (that is here running Android). To have enough guarantee, such hardware should have good technical documentation and the code using it should have good peer review (It should be good enough if it is in upstream Linux). h2. System on a chip This lists system on a chip that also Include a modem and have shared memory between the modem and the processor running Android, and the way the modem and the processor running Android are isolated or not. |_. Vendor |_. System on a chip |_. Isolation |_. Market share |_. References | | Qualcomm | Mobile Station Modem (MSM) Snapdragon 7x30 | Bad: * The modem is in charge of loading the bootloader of the processor running Android. Because of that it can temper with that bootloader and take control of the processor running Android. * The modem can access the memory of the processor running Android, and can take control of it through that way. * The modem has access to the storage of the processor running Android, so it can take control of it through that. | ? | "boot process":http://tjworld.net/wiki/Android/HTC/Vision/BootProcess | | Qualcomm | Snapdragon S4 | Unknown: * The modem is booted by the processor running Android (which in turn is booted by a separate boot processor called RPM) * There is not enough public documentation to understand if there is enough isolation between the modem and the processor running android. | ? | *"Boot process":https://forum.xda-developers.com/showthread.php?t=1769411&page=25 *"The Security of chip fabric page of rpw-pacsec2013-hexagon.pdf":https://web.archive.org/web/20131224103934if_/https://rpw.io/slides/rpw-pacsec2013-hexagon.pdf | h2. Devices This lists devices that have the modem and the processor running Android in separate chips and use shared memory between them, along with the way the processor running Android is isolated from the modem, or not. |_. Vendor |_. Device |_. Isolation |_. References | | Samsung | Nexus S | ? | ? | | Samsung | Galaxy S | ? | ? | h1. Isolated modems h2. Supported devices |_. Vendor |_. Device |_. Link |_. Isolation |_. References | |/8. Samsung | Galaxy Nexus (I9250) |/3. MIPI |/3. * With MIPI it's most probably not possible for the peripheral to access the host RAM | * "board-tuna.c:":https://git.replicant.us/replicant/kernel_samsung_tuna/plain/arch/arm/mach-omap2/board-tuna.c <pre> #ifdef CONFIG_OMAP_HSI_DEVICE if (TUNA_TYPE_MAGURO == omap4_tuna_get_type()) omap_hsi_init(); #endif </pre> * "modem_link_device_mipi.c":https://git.replicant.us/replicant/kernel_samsung_tuna/plain/drivers/misc/modem_if/modem_link_device_mipi.c | | Galaxy Tab 2 7.0 (P31xx) |/2. * "espresso_defconfig:":https://git.replicant.us/replicant/kernel_samsung_espresso10/plain/arch/arm/configs/espresso_defconfig?h=replicant-6.0 CONFIG_LINK_DEVICE_MIPI=y | | Galaxy Tab 2 10.1 (P51xx) | | Galaxy S 3 (I9300) |/5. HSIC |/5. * HSIC is a subset of the USB protocol => the peripheral has no access to the host RAM * The device cannot change USB IDs "without the host powering up and down the bus":https://pad.riseup.net/redirect#https%3A//github.com/fourkbomb/linux/commit/5c71c549206351c16412d23c38e3d8d62763f454 |/5. * "lineageos_i9300_defconfig:":https://git.replicant.us/replicant/kernel_samsung_smdk4412/plain/arch/arm/configs/lineageos_i9300_defconfig CONFIG_MODEM_M0 * "lineageos_i7000_defconfig:":https://git.replicant.us/replicant/kernel_samsung_smdk4412/plain/arch/arm/configs/lineageos_i7000_defconfig CONFIG_LINK_DEVICE_HSIC=y * "lineageos_i7100_defconfig:":https://git.replicant.us/replicant/kernel_samsung_smdk4412/plain/arch/arm/configs/lineageos_i7100_defconfig CONFIG_MODEM_M0 * "lineageos_i5100_defconfig:":https://git.replicant.us/replicant/kernel_samsung_smdk4412/plain/arch/arm/configs/lineageos_i5100_defconfig CONFIG_MODEM_M0 * "lineageos_i9100_defconfig:":https://git.replicant.us/replicant/kernel_samsung_smdk4412/plain/arch/arm/configs/lineageos_i9100_defconfig CONFIG_LINK_DEVICE_HSIC=y * "board-m0-modems.c":https://git.replicant.us/replicant/kernel_samsung_smdk4412/plain/arch/arm/mach-exynos/board-m0-modems.c | | Galaxy Note (N7000) | | Galaxy Note 2 (N7100) | | Galaxy Note 8.0 (N51xx) | | Galaxy S 2 (I9100) | h2. Powering off the modem h3. Android airplane mode interface interfaces The "RIL_REQUEST_RADIO_POWER command":https://git.replicant.us/LineageOS-mirror/android_hardware_ril/tree/include/telephony/ril.h#n2112 is used by the airplane mode. This could be implemented in a way that really powers off the modem instead of just asking the modem to turn off its transmissions. The advantage is that it's already implemented in the Android GUI. h3. current libsamsung-ril and libsamsung-ipc implementation "In libsamsung-ril, RIL_REQUEST_RADIO_POWER":https://git.replicant.us/replicant/hardware_ril_samsung-ril/tree/samsung-ril.c#n262 is implemneted in the "ril_request_radio_power":https://git.replicant.us/replicant/hardware_ril_samsung-ril/tree/power.c#n72 function which doesn't turn off the modem but asks it not to transmit by asking it to go in low power mode. This looks very similar to the AT command AT+CFUN. h3. Better implementation The airplane mode could be implemented in another way where the modem is powered off. The advantage of using the airplane mode for that is that it's already implemented in the Android GUI. We would also need to explain users that we implemented it this way, but that other Android distributions might have different implementations as their goal might differ. Doing again a full modem bootstrap will take longer than just asking the modem to go out of low power mode.