Looking for a secure smartphone running only free software? Good luck!

Motivation

On many occasions, I have seen myself and other members of the FSFE being asked which smartphones and mobile operating systems they can recommend to users who are looking for a free (owner-controlled) and secure smartphone that respects their freedom and privacy. I would like to share some of my thoughts about this complex topic. Please be warned, that it might be disappointing for those who might expect to get clear recommendations in the conclusion.

Operating Systems

In the following I want to briefly discussing pros and cons of a few mostly free mobile operating systems (skipping completely proprietary systems like iOS or Windows Phone). Mostly dead projects like B2G/FirefoxOS or Ubuntu Phone are not discussed either.

Stock Android

This is the binary Android distribution from Google and comes pre-installed on Google/Pixel devices.

  • Verified boot with locked bootloaders (but you have to trust the vendor)
  • Regular updates, once per month, available directly from upstream
  • Only available for Nexus/Pixel devices
  • Limited support period (18 months for Nexus devices, 3 years for Pixel devices) but clearly communicated
  • All supported devices require vast amounts of binary-only, proprietary firmware
  • Google Apps and Services are pre-installed and not removable.
  • Standard Android Security
  • Vendor-modified Android

    This is the Android distribution from typical OEMs like Samsung, HTC, LG, Sony, Huawei etc. that is based on Stock Android and customized by the OEM and in case of “branded” devices also by the network operator.

  • Ultimate choice of devices
  • Verified boot with locked bootloaders (but you have to trust the OEM), at least for most devices
  • Google Apps and Services are pre-installed and not removable.
  • Updates highly dependant on the OEM; often irregular, delayed or incomplete, sometimes no updates at all
  • Additional customizations by network operators often lead to further delayed updates
  • Often unclear support periods (depending on the vendor) and no formal EOL declaration
  • Almost all devices require binary-only, proprietary firmware (a few devices require not that much firmware, but most devices require a lot)
  • Standard Android Security
  • In many cases, the whole distribution is not directly available as a “factory image” from the vendor (depends on the vendor, but most of them do not provide such downloads). In most cases, flashing requires non-free software by the OEM that in turn only runs on non-free operating Systems such as Windows or OS X.
  • AOSP

    This is the source distribution of Android from Google.

  • Does not include Google Apps and Services
  • Regular updates, once per month, usually released shortly after new Stock Android builds
  • Limited support period (18 months for Nexus devices, 3 years for Pixel devices) but clearly communicated
  • Has to be self-compiled by the user (instructions only available for Nexus/Pixel devices as well as few 3rd party devices, e.g. some from Sony)
  • Verified boot with locked bootloaders and user-supplied keys (but only on Nexus/Pixel devices)
  • Almost all supported devices require vast amounts of binary-only, proprietary firmware
  • Copperhead OS

    A custom Android distribution provided by a community-oriented company. Based on AOSP with a strong focus on security.

  • Does not include Google Apps and Services
  • Some apps from AOSP have been replaced by more privacy-oriented alternatives (e.g. the calendar).
  • Much more than standard Android security: Hardened kernel and userland, privacy-friendly defaults
  • Binary downloads on website only for Nexus/Pixel devices and a development board
  • Regular updates, once per month (vendor promises to make them available within 24 hours after updates in AOSP became available)
  • Limited support period (18 months for Nexus devices, 3 years for Pixel devices) but clearly communicated
  • Verified boot with locked bootloaders and user-supplied keys (but only on Nexus/Pixel devices)
  • All supported smartphones require vast amounts of binary-only, proprietary firmware (the Hikey 960 does not, but it is not a smartphone)
  • All modifications are open source, but commercial redistribution is prohibited. Thus, the FSFE would not consider it free software.
  • Lineage OS

    A custom Android distribution based on AOSP but with heavy modifications. Developed by a large community of volunteers.

  • Does not include Google Apps and Services by default
  • Regular updates, but security patches are sometimes delayed or incomplete
  • Verified boot with locked bootloaders and user-supplied keys (but only on Nexus/Pixel devices) theoretically possible (but afaik no official instructions provided)
  • Backports security patches to Android versions which are not supported by Google anymore (but not forever)
  • Supports devices that are EOL by their original vendors since years, however, actual support period by LineageOS is not clear in advance and official EOL has often not been clearly communicated in the past.
  • Lower security than on standard Android due to userdebug builds by default
  • Broad support for a huge number of devices
  • All supported devices require binary-only, proprietary firmware (a few devices require not that much non-free firmware, but most devices require a lot)
  • OmniROM

    A custom Android distribution based on AOSP with moderate modifications. Developed by a community of volunteers.

  • Similar to Lineage OS with respect to the discussed properties
  • Slightly higher security because uses “eng” builds by default
  • Limited device support
  • Provides security updates usually only for the most recent branch
  • Replicant

    A custom Android distribution based on Lineage OS 13. Developed by very few community volunteers but strongly backed by many free software enthusiasts.

  • Does not include Google Apps and Services by default
  • Irregular updates, security patches are heavily delayed
  • All supported devices run completely without binary-only, proprietary firmware on the main processor (but on no device functionality such as GPS, Bluetooth, 3D acceleration is available and Wifi works only with one selected model of external USB adapters). Non-free firmware for baseband processor is still required.
  • None of the supported devices supports verified boot (all require an unlocked bootloader)
  • Even with a closed bootloader, many of the supported devices have severe security issues (e.g. storage is directly accessible via the insecure odin protocol)
  • postmarketOS

    A “classic” Linux distribution targeted also on legacy smartphones vastly considered obsolete. Developed by volunteeers. Based on Alpine Linux, thus very lightweight.

  • Nice and clear architectural design
  • Classic distro packages instead of app store
  • Not really useable yet, under heavy development
  • Regular updates, just like a normal Linux distribution
  • Choice between several UIs (most promising to me: Plasma Mobile), however, none of them seems Production-ready yet
  • Partial support for a large number of devices, but not a single device seems ready for daily usage as a smartphone
  • Verified boot with locked bootloaders and user-supplied keys theoretically possible (only on Nexus/Pixel devices) but afaik not implemented yet.
  • pureOS

    (I have no personal experience with this OS, thus the following information is just from my research)

    Another “classic” Linux distribution but primarily targeted at “Librem” devices by purism. Based on Debian Testing.

  • Convergence approach
  • Under heavy development, not available yet for phones
  • Support for GNOME and KDE Plasma Mobile planned
  • No information about planned support period available yet
  • Nothing concrete known about security features such as verified boot yet
  • Sailfish OS

    (I have no personal experience with this OS, thus the following information is just from my research)

    A Linux-based operating system that supports Android apps through an compatibility layer. Has an open core but a closed source UI that is based on QT5.

  • Not all parts are open source, using vendor-provided binaries requires purchasing a license
  • Very limited number of devices officially supported (as of now, only one Sony device is globally purchaseable)
  • Community-backed ports for many devices such as the Fairphone 2 are available
  • All supported devices (officially and by the community) require binary-only, proprietary firmware (a few devices require not that much non-free firmware, but most devices require a lot)
  • OS-independent freedom and security concerns

    Firmware vulnerabilities

    If you run non-free firmware that is required to operate most smartphones (which is always required except if you run Replicant and can live with severely degraded functionality) you are the mercy of the vendor to provide you with updates. However, there are critical vulnerabilities in some of these firmwares. But even in extreme cases such as the “Broadpwn” exploit (affects BCM43xx wifi chipsets found on more than a billion of devices), vendors often refuse to provide updated firmware if the affected devices are outside of the official support period.

    Bootloader freedom

    As far as I know, there are no modern smartphones which come preinstalled with a free bootloader or where the proprietary bootloader can be replaced. Few exception may be some (quite dated) devices supported by postmarketOS such as the Nokia N900.

    Hardware-backed security firmware

    Modern SoCs come with a TEE (Trusted Execution Environment) as part of their chip design. These separate systems are used for securely processing/storing credentials such as fingerprints or (parts of) device encryption keys. Usually, these subsystems are closed source. Thus, their proper operation is difficult to audit (although the developers of CopperheadOS claim to have succeeded in doing this [2]).

    Separation of SoC and baseband

    Many modern do not have a clear separation between the baseband processor (that runs the non-free radio firmware) and the SoC. This means, that you actually have to trust the firmware of the baseband firmware vendor. There is at least one known case of a backdoor built into the layer above that was detected on older Samsung devices and mitigated by Replicant developers [3].

    Other partitions with non-free binaries and data

    Some people may think that by re-flashing a ROM or factory image they return their device to the original state. However, todays smartphones often contain a bunch of partitions, but most of them remained untouched during flashing. For instance, here is a listing of partition names and corresponding flash partitions from a Nexus 5:

    DDR	->	/dev/block/mmcblk0p24
    aboot	->	/dev/block/mmcblk0p6
    abootb	->	/dev/block/mmcblk0p11
    boot	->	/dev/block/mmcblk0p19
    cache	->	/dev/block/mmcblk0p27
    crypto	->	/dev/block/mmcblk0p26
    fsc	->	/dev/block/mmcblk0p22
    fsg	->	/dev/block/mmcblk0p21
    grow	->	/dev/block/mmcblk0p29
    imgdata	->	/dev/block/mmcblk0p17
    laf	->	/dev/block/mmcblk0p18
    metadata	->	/dev/block/mmcblk0p14
    misc	->	/dev/block/mmcblk0p15
    modem	->	/dev/block/mmcblk0p1
    modemst1	->	/dev/block/mmcblk0p12
    modemst2	->	/dev/block/mmcblk0p13
    pad	->	/dev/block/mmcblk0p7
    persist	->	/dev/block/mmcblk0p16
    recovery	->	/dev/block/mmcblk0p20
    rpm	->	/dev/block/mmcblk0p3
    rpmb	->	/dev/block/mmcblk0p10
    sbl1	->	/dev/block/mmcblk0p2
    sbl1b	->	/dev/block/mmcblk0p8
    sdi	->	/dev/block/mmcblk0p5
    ssd	->	/dev/block/mmcblk0p23
    system	->	/dev/block/mmcblk0p25
    tz	->	/dev/block/mmcblk0p4
    tzb	->	/dev/block/mmcblk0p9
    userdata	->	/dev/block/mmcblk0p28
    

    Even if you flash the factory ROM provided by Google, it only touches a few of these partitions. The other parts remain unchanged. It is hard to find documentation on what the purpose of these partitions is and, depending on the device, there are many different partitions. Also, for partitions that usually don’t change I haven’t seen any list of hashes from OEMs. Therefore, if you buy a used phone you have to be aware that there is (1) no official way to reset these partitions to their factory state and (2) it’s hard to tell if any of these partitions have been modified. Most of these partitions can be modified if you have root access, therefore, if you ever executed something with root rights it could have tampered with one of those.

    Conclusion and recommendations

    Given the current situation, providing recommendations is hard as it highly depends on these factors:

    • your willingness to run non-free software (esp. firmware)
    • your trust in particular SoC vendors
    • your threat perceptions (e.g. do you see more threats from local or from remote attackers?)

    The options I would recommend are as follows (order is arbitrary and SailfishOS was not considered due to my lack of experience with it):

    • Get a device supported by Replicant (Samsung Galaxy S2, Galaxy S3 or Galaxy Note 1), live with the degraded functionality and the devices’ trivial local exploitability. If you can, support development towards newer LineageOS versions to get OS-level security updates with less delays in the future.
    • Get a recent (still-supported) Nexus/Pixel devices and run CopperheadOS on it. You will be secured as good as possible from local and OS-level remote attacks and get OS and firmware updates every month. However, you have to fully trust the SoC platform and its (non-separated) baseband firmware. In addition, you have to pollute the environment by switching to newer devices once your device runs out of support.
    • Support the Librem 5 campaign and hope purism will keep their promises for choosing libre-friendly hardware (if you ask me, they should concentrate on these issues, abandon pureOS and support postmarketOS instead).
    • Recycle an old device and support postmarketOS and other free software projects like Plasma Mobile to help building a free alternative to Android. This might become interesting if we succeed in lowering the dependencies on non-free firmware with the availability of devices like the Librem 5 (provided the vendor keeps their promises).

    References

    [1] https://blogs.fsfe.org/kuleszdl/2018/03/31/securing-copperheados-by-using-separate-encryptionlockscreen-passphrases/
    [2] https://github.com/copperhead/bugtracker/issues/451
    [3] https://www.fsf.org/blogs/community/replicant-developers-find-and-close-samsung-galaxy-backdoor