-
Notifications
You must be signed in to change notification settings - Fork 201
Add systemd unit to mount persist partition
#1484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
|
||
| [Unit] | ||
| Description=Mount persist partition at /var/lib/tee | ||
| Before=local-fs.target | ||
|
|
||
| [Mount] | ||
| DirectoryMode=0755 | ||
| What=/dev/disk/by-partlabel/persist | ||
| Where=/var/lib/tee | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it the only dir which we need to persist? TQFTP engineers also want to have some persistent data.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least this partition was created with the QTEE justification, but this is a good question.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If both QTEE & TQFTP both need this partition, is the path
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, but AFAIK we only had QTEE requesting this type of persistent data (as it can be related with security keys and credentials).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #1445 (comment)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ricardosalveti we had a whole other subthread here: qualcomm-linux/qcom-ptool#66 I'm not sure the precious data that we're trying to save is provisioned at factory time. IIUC, there is device-specific licenses that are precious and end up in an app-specific section of the QTEE persistent storage. There are backups in the HLOS' rootfs, and persist is kept separate to avoid paying a fee if one reprovisions the device except for persist. I agree with the high-level need to have ways to protect precious data. Things I'm personally unclear about:
I wonder if we should flip this whole design around: provide a generic partition for backups of things that are potential precious and can be used as a recovery point from HLOS. This could look like:
I wish this was something somewhat standard that we're not the only ones doing. Would FDO have a story for this?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @lool , Allow me to clarify a few things further.
Thanks!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @harshaldev27 and BTW thanks for the time you're taking in educating me (and I hope others) on some of these topics
So you're making specific use of the persist filesystem; what happens if that filesystem gets corrupted?
Personally (on other SoCs) I saw cases of higher level device management certificates (e.g greengrass), device encryption keys for the HLOS, and app level passwords. In an ideal design, these are stored / accessed through TZ, but not always feasible (no TZ, hard to integrate etc.).
We might need the right terminology, how would you call "I want to fix the system after a broken OTA, but keep the precious data"? Reprovision the HLOS?
I guess this is due to the atomic thingy you mentioned earlier; it sounds like some A/B mechanism within the persist partition. Overall, it feels like this TEE space is solving its problem in its bubble for itself, but its lifecycle requirements require some HLOS integration (provisioning, boot, recovery). I'm trying to see if this can be generalized so that we don't do a TEE-specific or – worse – a QTEE-specific HLOS integration.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the moment I would say that this TEE-specific, and compatible with both QTEE and OP-TEE (we had similar needs in foundries, using a separated partition for OP-TEE).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I can understand your comments from standard Linux distros point of view especially Debian where the TEE based use-cases for IoT/Mobile/Edge systems are less known or implemented. Although hardware TPM based use-cases are more prevalent there. Many of the TPM related use-cases can be supported with TEE especially with the support of TEE based firmware TPMs. The TEE based use-cases are mostly prevalent in Yocto and Android environments. But for sure standard distros gaining momentum in the IoT/Mobile/Edge systems, we surely would need to get at-least Debian support for TEE based security use-cases.
Yeah, IIRC from my Linaro days folks already started exploring standard FDO provisioning using Fedora with OP-TEE as well. Not sure the current status of that work. Anyhow, we are not alone here as all other silicon vendors in the IoT space offer TEE solutions but I feel the standard distros integration is still missing.
That's right since TEE environments (whether QTEE/OP-TEE) is pretty constrained due to small footprint design goals. For that reason, it depends on HLOS for all the file-system services for secure storage. And yes there is use of RPMB for secure storage as well but it's pretty limited in terms of storage space. Regarding usage of separate partition for secure storage, it usually becomes handy when you have to deal with A/B firmware and OS updates with the rollback counters stored in that secure storage based on the separate partition. That's additional use-case to what has been mentioned earlier related to secrets (key/data) provisioning. |
||
| Type=ext4 | ||
|
|
||
| [Install] | ||
| WantedBy=local-fs.target | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| SUMMARY = "Systemd unit to mount persist parition at /var/lib/tee" | ||
vkraleti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| DESCRIPTION = "Mount persist partition at /var/lib/tee to store \ | ||
| encryped data and support security functions" | ||
| LICENSE = "BSD-3-Clause-Clear" | ||
| LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/BSD-3-Clause-Clear;md5=7a434440b651f4a472ca93716d01033a" | ||
|
|
||
| SRC_URI = "file://var-lib-tee.mount" | ||
|
|
||
| inherit allarch features_check systemd | ||
| REQUIRED_DISTRO_FEATURES = "systemd" | ||
|
|
||
vkraleti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| INHIBIT_DEFAULT_DEPS = "1" | ||
|
|
||
| S = "${UNPACKDIR}" | ||
|
|
||
| do_compile[noexec] = "1" | ||
|
|
||
| do_install() { | ||
| install -Dm 0644 ${UNPACKDIR}/var-lib-tee.mount \ | ||
| ${D}${systemd_unitdir}/system/var-lib-tee.mount | ||
| } | ||
|
|
||
| PACKAGES = "${PN}" | ||
|
|
||
| SYSTEMD_SERVICE:${PN} = "var-lib-tee.mount" | ||
Uh oh!
There was an error while loading. Please reload this page.