lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241126091042.918144-1-arnaud.pouliquen@foss.st.com>
Date: Tue, 26 Nov 2024 10:10:31 +0100
From: Arnaud Pouliquen <arnaud.pouliquen@...s.st.com>
To: Bjorn Andersson <andersson@...nel.org>,
        Mathieu Poirier
	<mathieu.poirier@...aro.org>,
        Rob Herring <robh@...nel.org>,
        "Krzysztof
 Kozlowski" <krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>,
        "Maxime
 Coquelin" <mcoquelin.stm32@...il.com>,
        Alexandre Torgue
	<alexandre.torgue@...s.st.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer
	<s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        Neil Armstrong
	<neil.armstrong@...aro.org>,
        Kevin Hilman <khilman@...libre.com>,
        "Jerome
 Brunet" <jbrunet@...libre.com>,
        Martin Blumenstingl
	<martin.blumenstingl@...glemail.com>,
        Matthias Brugger
	<matthias.bgg@...il.com>,
        AngeloGioacchino Del Regno
	<angelogioacchino.delregno@...labora.com>,
        Patrice Chotard
	<patrice.chotard@...s.st.com>,
        Fabien Dessenne <fabien.dessenne@...s.st.com>,
        Arnaud Pouliquen <arnaud.pouliquen@...s.st.com>
CC: <linux-remoteproc@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
        <imx@...ts.linux.dev>, <linux-amlogic@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>, <linux-arm-msm@...r.kernel.org>
Subject: [PATCH v14 0/8] Introduction of a remoteproc tee to load signed firmware

Main updates from version V13[1]:
- Introduce new rproc_ops operation: load_fw() and release_fw(),
- Rename load() operation to load_segments() in rproc_ops structure and
  drivers.

More details are available in each patch commit message.

[1] https://lore.kernel.org/linux-arm-kernel/20241104133515.256497-1-arnaud.pouliquen@foss.st.com/T/

Tested-on: commit 42f7652d3eb5 ("Linux 6.12-rc4")
Description of the feature:
--------------------------
This series proposes the implementation of a remoteproc tee driver to
communicate with a TEE trusted application responsible for authenticating
and loading the remoteproc firmware image in an Arm secure context.

1) Principle:

The remoteproc tee driver provides services to communicate with the OP-TEE
trusted application running on the Trusted Execution Context (TEE).
The trusted application in TEE manages the remote processor lifecycle:

- authenticating and loading firmware images,
- isolating and securing the remote processor memories,
- supporting multi-firmware (e.g., TF-M + Zephyr on a Cortex-M33),
- managing the start and stop of the firmware by the TEE.

2) Format of the signed image:

Refer to:
https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/src/remoteproc_core.c#L18-L57

3) OP-TEE trusted application API:

Refer to:
https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/include/ta_remoteproc.h

4) OP-TEE signature script

Refer to:
https://github.com/OP-TEE/optee_os/blob/master/scripts/sign_rproc_fw.py

Example of usage:
sign_rproc_fw.py --in <fw1.elf> --in <fw2.elf> --out <signed_fw.sign> --key ${OP-TEE_PATH}/keys/default.pem


5) Impact on User space Application

No sysfs impact. The user only needs to provide the signed firmware image
instead of the ELF image.


For more information about the implementation, a presentation is available here
(note that the format of the signed image has evolved between the presentation
and the integration in OP-TEE).

https://resources.linaro.org/en/resource/6c5bGvZwUAjX56fvxthxds

Arnaud Pouliquen (8):
  remoteproc: core: Introduce rproc_pa_to_va helper
  remoteproc: Add TEE support
  remoteproc: Introduce load_fw and release_fw optional operation
  remoteproc: Rename load() operation to load_segments() in rproc_ops
    struct
  remoteproc: Make load_segments and load_fw ops exclusive and optional
  dt-bindings: remoteproc: Add compatibility for TEE support
  remoteproc: stm32: Create sub-functions to request shutdown and
    release
  remoteproc: stm32: Add support of an OP-TEE TA to load the firmware

 .../bindings/remoteproc/st,stm32-rproc.yaml   |  58 +-
 drivers/remoteproc/Kconfig                    |  10 +
 drivers/remoteproc/Makefile                   |   1 +
 drivers/remoteproc/imx_dsp_rproc.c            |   2 +-
 drivers/remoteproc/imx_rproc.c                |   2 +-
 drivers/remoteproc/meson_mx_ao_arc.c          |   2 +-
 drivers/remoteproc/mtk_scp.c                  |   2 +-
 drivers/remoteproc/qcom_q6v5_adsp.c           |   2 +-
 drivers/remoteproc/qcom_q6v5_mss.c            |   2 +-
 drivers/remoteproc/qcom_q6v5_pas.c            |   4 +-
 drivers/remoteproc/qcom_q6v5_wcss.c           |   4 +-
 drivers/remoteproc/qcom_wcnss.c               |   2 +-
 drivers/remoteproc/rcar_rproc.c               |   2 +-
 drivers/remoteproc/remoteproc_core.c          |  68 ++-
 drivers/remoteproc/remoteproc_internal.h      |  20 +-
 drivers/remoteproc/remoteproc_tee.c           | 508 ++++++++++++++++++
 drivers/remoteproc/st_remoteproc.c            |   2 +-
 drivers/remoteproc/st_slim_rproc.c            |   2 +-
 drivers/remoteproc/stm32_rproc.c              | 141 +++--
 drivers/remoteproc/xlnx_r5_remoteproc.c       |   2 +-
 include/linux/remoteproc.h                    |  20 +-
 include/linux/remoteproc_tee.h                | 105 ++++
 22 files changed, 893 insertions(+), 68 deletions(-)
 create mode 100644 drivers/remoteproc/remoteproc_tee.c
 create mode 100644 include/linux/remoteproc_tee.h


base-commit: adc218676eef25575469234709c2d87185ca223a
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ