|
|
Subscribe / Log in / New account

Security

A kernel TEE party

By Jonathan Corbet
March 15, 2017
The operating system kernel is normally thought of as having power over the entire system, but there are reasons, both good and bad, for wanting to isolate some functionality even from the kernel. One example is the trusted platform module (TPM) found on many x86 systems; it can provide various cryptographic services to the kernel, but its internals are not accessible to kernel code. In the ARM world, this kind of functionality is often provided via the TrustZone mechanism, but the kernel has no standardized way of working with TrustZone code. The generic TEE subsystem patches from Jens Wiklander aim to change that state of affairs.

A processor with TrustZone support can run in two modes, often termed the secure and non-secure worlds. The secure world can be given exclusive access to memory, devices, and more; those resources are inaccessible when running in the non-secure mode. A hardware trap mechanism is used to transition between the two worlds. The secure-world code, thus, looks a lot like an innermost kernel, protected from the Linux kernel, that has a limited set of security-relevant tasks to perform.

The secure world gains control first at boot time, allowing it to set up access to the rest of its resources and configure the environment for the non-secure kernel. This would also be the time to implement a secure-boot mechanism, if desired, ensuring that the non-secure kernel carries an acceptable signature. A number of functions can be implemented in the secure-world code. For example, cryptographic keys can be stored there, inaccessible to the rest of the system, but usable by the secure world to generate signatures. Naturally, there is interest in using the secure world to implement digital rights management mechanisms and other unpleasant things. Like most of these technologies, TrustZone can be used to ensure a user's control over their computer or to take it away.

The code running in the secure world is often called the "trusted execution environment", or TEE (as opposed to the non-secure "rich execution environment" or REE). As befits the ARM world, there are a lot of TEEs out there, each with its own interface to the kernel. The purpose of the generic TEE subsystem is to settle on one kernel-side interface for TEEs, with a standard communication mechanism for talking to them. To that end, it creates two sets of devices: /dev/teeN, and /dev/teeprivN. The former set allows user space to make requests of the TEE, while the latter is there for "supplicant" processes that provide services to the TEE.

A process needing a TEE service opens the appropriate device, then issues a series of ioctl() calls. The available commands include TEE_IOC_SHM_ALLOC to allocate a range of memory shared between the process and the TEE, TEE_IOC_INVOKE to call a function inside the TEE, and more. For each call, the TEE generates some sort of results which are passed back to the calling process. For the /dev/teepriv interfaces, the calls go the other way; when the TEE needs a user-space service (the contents of a file on disk, say), it will send a request to the waiting supplicant process via this interface.

The generic TEE code is, for the most part, a wrapper layer that turns user-space ioctl() calls into calls to the low-level driver. That driver will have registered itself, providing a tee_driver_ops structure with its operations. The biggest exception relates to the handling of shared-memory segments, which involves a certain amount of complexity. There is a fairly elaborate reference-counting mechanism that, for example, tracks the references created by every parameter passed into a TEE operation; that ensures that the memory is not freed while references still exist.

The low-level driver code is charged with communicating between the generic TEE layer and the actual TEE implementation. Much of this code is concerned with formatting requests as expected by the TEE and low-level communications. Shared memory is also an issue at this level, since mapping memory that the TEE can access requires cooperation with the TEE itself.

The generic TEE subsystem patches come with a driver for one TEE, an open-source implementation called OP-TEE. This system, developed by STMicroelectronics and Linaro, provides a simple operating-system kernel meant to run in the secure world. OP-TEE is meant to be the substrate on which TEEs are created; those wanting to learn more can have a look at this design document. There is also an OP-TEE "hello world" application giving an idea of what secure-world code looks like.

All of this structure is intended to build things like the OP-TEE secure data path (recently presented at Linaro Connect), the purpose of which is to enable Android devices to play protected content without letting the end users actually get their hands on it. But a free TEE environment should also make it easy to develop less user-hostile secure services as free software. Once the generic TEE patches are merged (something that seems like it should happen sometime this year), we'll have a standard interface for providing and using such services.

Comments (none posted)

Brief items

Security quotes of the week

It's not just prior restraint on those served with an order. It's prior restraint that effectively silences everyone in the law's jurisdiction. Site A's order and subsequent content removal can't be discussed anywhere on that site. And Site A can't point to other sites discussing Site A's content removal, even if these other sites lie outside the law's jurisdiction.

This bill should -- if there's any amount of brain activity in the NY legislature -- die a swift and unceremonious death. But nothing this bad stays dead forever. It will return in some other shape or form months or years later because some people truly believe information doesn't want to be free -- it wants to be forgotten.

Tim Cushing on a "right to be forgotten" bill propose in New York state

At the same time, existing recommendations can be dizzying. For many users, blog posts on how to install Signal, massive guides to protecting your digital privacy, and broad statements like "use Tor" — all offered in good faith and with the best of intentions — can be hard to understand or act upon. If we want to truly secure civil society from digital attacks and empower communities in their to fight to protect their rights, we've got to recognize that digital security is largely a human problem, not a technical one. Taking cues from the experiences of the deeply knowledgeable global digital security training community, the Digital Security Exchange will seek to make it easier for trainers and experts to connect directly to communities in the U.S. — building trust and sharing expertise, documentation, and best practices — in order to increase capacity and security across the board.
Josh Levy announces the Digital Security Exchange project

When secrecy is truly paramount, go back to communications systems that are still ephemeral. Pick up the telephone and talk. Meet face to face. We don't yet live in a world where everything is recorded and everything is saved, although that era is coming. Enjoy the last vestiges of ephemeral conversation while you still can.
Bruce Schneier

Comments (2 posted)

Critical vulnerability under “massive” attack imperils high-impact sites (Ars Technica)

Ars Technica is reporting that a recently patched vulnerability in the Apache Struts 2 web framework is being actively exploited in the wild. "It's not clear why the vulnerability is being exploited so widely 48 hours after a patch was released. One possibility is that the Apache Struts maintainers didn't adequately communicate the risk. Although they categorize the vulnerability security rating as high, they also describe it as posing a 'possible remote code execution' risk. Outside researchers, meanwhile, have said the exploits are trivial to carry out, are highly reliable, and require no authentication. It's also easy to scan the Internet for vulnerable servers. It's also possible to exploit the bug even if a Web application doesn't implement file upload functionality."

Comments (24 posted)

Security updates

Alert summary March 9, 2017 to March 15, 2017

Dist. ID Release Package Date
Arch Linux ASA-201703-4 chromium 2017-03-11
Arch Linux ASA-201703-3 firefox 2017-03-10
Arch Linux ASA-201703-11 flashplugin 2017-03-15
Arch Linux ASA-201703-9 jasper 2017-03-14
Arch Linux ASA-201703-8 kernel 2017-03-14
Arch Linux ASA-201703-12 lib32-flashplugin 2017-03-15
Arch Linux ASA-201703-5 libxslt 2017-03-12
Arch Linux ASA-201703-7 linux-grsec 2017-03-13
Arch Linux ASA-201703-6 linux-lts 2017-03-13
Arch Linux ASA-201703-10 roundcubemail 2017-03-14
Arch Linux ASA-201703-2 thunderbird 2017-03-10
CentOS CESA-2017:0459 C5 firefox 2017-03-08
CentOS CESA-2017:0459 C6 firefox 2017-03-08
CentOS CESA-2017:0461 C7 firefox 2017-03-08
CentOS CESA-2017:0454 C5 kvm 2017-03-08
Debian DSA-3810-1 stable chromium-browser 2017-03-15
Debian DLA-852-1 LTS firefox-esr 2017-03-10
Debian DSA-3805-1 stable firefox-esr 2017-03-09
Debian DLA-854-1 LTS icoutils 2017-03-13
Debian DSA-3807-1 stable icoutils 2017-03-12
Debian DSA-3808-1 stable imagemagick 2017-03-13
Debian DLA-849-1 LTS kernel 2017-03-09
Debian DSA-3804-1 stable kernel 2017-03-08
Debian DSA-3809-1 stable mariadb-10.0 2017-03-14
Debian DLA-853-1 LTS pidgin 2017-03-11
Debian DSA-3806-1 stable pidgin 2017-03-10
Debian DLA-855-1 LTS roundcube 2017-03-13
Debian DLA-850-1 LTS vim 2017-03-09
Debian DLA-851-1 LTS wget 2017-03-09
Fedora FEDORA-2017-d2bab54ac9 F24 GraphicsMagick 2017-03-11
Fedora FEDORA-2017-c71a0f40f0 F25 GraphicsMagick 2017-03-09
Fedora FEDORA-2017-bcab179007 F24 drupal7-views 2017-03-09
Fedora FEDORA-2017-82ce4661d6 F25 drupal7-views 2017-03-09
Fedora FEDORA-2017-06365bdcfd F25 ettercap 2017-03-14
Fedora FEDORA-2017-f3484d64d2 F24 firefox 2017-03-10
Fedora FEDORA-2017-bb459964ce F25 firefox 2017-03-09
Fedora FEDORA-2017-3886afeb06 F24 freetype 2017-03-13
Fedora FEDORA-2017-c09c0cc384 F25 freetype 2017-03-12
Fedora FEDORA-2017-b011e8c922 F24 kdelibs 2017-03-11
Fedora FEDORA-2017-01eed6fe8c F24 kdelibs3 2017-03-12
Fedora FEDORA-2017-4f4eef4791 F25 kdelibs3 2017-03-12
Fedora FEDORA-2017-2e1f3694b2 F24 kernel 2017-03-11
Fedora FEDORA-2017-387ff46a66 F25 kernel 2017-03-11
Fedora FEDORA-2017-038e821698 F25 knot 2017-03-09
Fedora FEDORA-2017-038e821698 F25 knot-resolver 2017-03-09
Fedora FEDORA-2017-3bd0b2e2c0 F24 libupnp 2017-03-13
Fedora FEDORA-2017-2c29702300 F25 libupnp 2017-03-10
Fedora FEDORA-2017-9a5b89363f F24 libwmf 2017-03-13
Fedora FEDORA-2017-25df1dbd02 F24 munin 2017-03-10
Fedora FEDORA-2017-3776c9d747 F25 munin 2017-03-10
Fedora FEDORA-2017-aaf92c483c F24 php-pear-PHP-CodeSniffer 2017-03-10
Fedora FEDORA-2017-ca3f01bd37 F25 php-pear-PHP-CodeSniffer 2017-03-10
Fedora FEDORA-2017-e63f2f0d11 F24 thunderbird 2017-03-13
Fedora FEDORA-2017-fce0c6fd46 F25 thunderbird 2017-03-12
Fedora FEDORA-2017-5b32a5782b F24 tor 2017-03-13
Fedora FEDORA-2017-6f3ea63acc F25 tor 2017-03-14
Fedora FEDORA-2017-2e6b693937 F25 w3m 2017-03-14
Fedora FEDORA-2017-6c91c98b33 F25 wireshark 2017-03-12
Mageia MGASA-2017-0074 5 flac 2017-03-12
Mageia MGASA-2017-0075 5 flash-player-plugin 2017-03-12
Mageia MGASA-2017-0073 5 potrace 2017-03-12
Mageia MGASA-2017-0076 5 wireshark 2017-03-12
openSUSE openSUSE-SU-2017:0664-1 42.2 Wireshark 2017-03-11
openSUSE openSUSE-SU-2017:0669-1 42.1 42.2 bitlbee 2017-03-11
openSUSE openSUSE-SU-2017:0663-1 42.1 42.2 cacti 2017-03-11
openSUSE openSUSE-SU-2017:0690-1 42.1 42.2 firefox, mozilla-nss 2017-03-14
openSUSE openSUSE-SU-2017:0677-1 kdelibs4, kio 2017-03-13
openSUSE openSUSE-SU-2017:0680-1 42.1 42.2 kdelibs4, kio 2017-03-13
openSUSE openSUSE-SU-2017:0668-1 42.1 42.2 lynx 2017-03-11
openSUSE openSUSE-SU-2017:0674-1 42.1 openssh 2017-03-13
openSUSE openSUSE-SU-2017:0678-1 42.1 42.2 pax-utils 2017-03-13
openSUSE openSUSE-SU-2017:0667-1 42.1 42.2 perl-Image-Info 2017-03-11
openSUSE openSUSE-SU-2017:0648-1 42.1 42.2 potrace 2017-03-10
openSUSE openSUSE-SU-2017:0649-1 42.1 sane-backends 2017-03-10
openSUSE openSUSE-SU-2017:0688-1 thunderbird 2017-03-14
openSUSE openSUSE-SU-2017:0687-1 42.1 42.2 thunderbird 2017-03-14
openSUSE openSUSE-SU-2017:0665-1 42.2 xen 2017-03-11
Oracle ELSA-2017-0459 OL5 firefox 2017-03-08
Oracle ELSA-2017-0459 OL6 firefox 2017-03-08
Oracle ELSA-2017-0461 OL7 firefox 2017-03-08
Oracle ELSA-2017-0498 OL6 thunderbird 2017-03-14
Oracle ELSA-2017-0498 OL7 thunderbird 2017-03-14
Red Hat RHSA-2017:0499-01 EL6 chromium-browser 2017-03-14
Red Hat RHSA-2017:0459-01 EL5 EL6 firefox 2017-03-08
Red Hat RHSA-2017:0461-01 EL7 firefox 2017-03-08
Red Hat RHSA-2017:0526-01 EL6 flash-plugin 2017-03-15
Red Hat RHSA-2017:0501-01 EL7.2 kernel 2017-03-14
Red Hat RHSA-2017:0536-01 EL7.1 policycoreutils 2017-03-15
Red Hat RHSA-2017:0535-01 EL7.2 policycoreutils 2017-03-15
Red Hat RHSA-2017:0532-01 OSP5.0/EL7 rabbitmq-server 2017-03-15
Red Hat RHSA-2017:0531-01 OSP6.0/EL7 rabbitmq-server 2017-03-15
Red Hat RHSA-2017:0530-01 OSP7.0/EL7 rabbitmq-server 2017-03-15
Red Hat RHSA-2017:0498-01 EL5 EL6 EL7 thunderbird 2017-03-14
Red Hat RHSA-2017:0527-01 EL6 tomcat6 2017-03-15
Scientific Linux SLSA-2017:0459-1 SL5 SL6 firefox 2017-03-08
Scientific Linux SLSA-2017:0461-1 SL7 firefox 2017-03-08
Scientific Linux SLSA-2017:0498-1 SL5 SL6 SL7 thunderbird 2017-03-14
Scientific Linux SLSA-2017:0527-1 SL6 tomcat6 2017-03-15
SUSE SUSE-SU-2017:0661-1 SLE12 qemu 2017-03-10
SUSE SUSE-SU-2017:0647-1 SLE11 xen 2017-03-10
Ubuntu USN-3226-1 12.04 icoutils 2017-03-13
Ubuntu USN-3227-1 12.04 14.04 16.04 16.10 icu 2017-03-13
Ubuntu USN-3232-1 12.04 14.04 16.04 16.10 imagemagick 2017-03-14
Ubuntu USN-3223-1 12.04 14.04 kde4libs 2017-03-09
Ubuntu USN-3225-1 12.04 14.04 16.04 16.10 libarchive 2017-03-09
Ubuntu USN-3228-1 12.04 14.04 16.04 16.10 libevent 2017-03-13
Ubuntu USN-3220-3 16.04 linux-aws 2017-03-08
Ubuntu USN-3224-1 14.04 16.04 16.10 lxc 2017-03-09
Ubuntu USN-3231-1 12.04 14.04 pidgin 2017-03-14
Ubuntu USN-3230-1 14.04 16.04 16.10 pillow 2017-03-13
Ubuntu USN-3229-1 12.04 python-imaging 2017-03-13
Full Story (comments: 2)

Page editor: Jake Edge
Next page: Kernel development>>


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds