-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sync with latest sources of TrebleDroid
- Loading branch information
1 parent
9ef5ebc
commit f8478b6
Showing
33 changed files
with
442 additions
and
31 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
patches/trebledroid/platform_system_core/0001-Let-system-override-ro.apex.updatable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0002-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ledroid/platform_system_core/0003-init-Do-not-start-console-service-when-debuggable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/trebledroid/platform_system_core/0004-Panic-into-recovery-rather-than-bootloader.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/trebledroid/platform_system_core/0005-Detect-allowed-sdcard-options-based-on-vndk.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0006-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...hes/trebledroid/platform_system_core/0007-Revert-Set-system-xbin-permissions-to-750.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/trebledroid/platform_system_core/0008-Add-my-own-OTA-mechanism-going-over-data.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/trebledroid/platform_system_core/0009-fs_mgr-Keep-allowing-encryptable-fstab-flag.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0010-FDE-is-dead.-Fallback-FDE-to-no-encryption-and-FDE-F.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0011-Let-system-override-adb-secure-props-so-we-dont-get-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0012-Allow-apex-on-5.0-kernels.-This-is-needed-because-on.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/trebledroid/platform_system_core/0013-watchdogd-Support-pinging-two-watchdogs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/trebledroid/platform_system_core/0014-healthd-offline-charger-fix-screen-off-3-3.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0015-Disable-quotas-on-legacy-devices-with-encryption-dis.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0016-Add-vendor-firmware_mnt.-Moto-Razr-2019-look-for-fir.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/trebledroid/platform_system_core/0017-Ignore-dm-verity-setup-issues.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...bledroid/platform_system_core/0018-Fix-support-for-devices-without-cgroupv2-support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0019-Disable-project_quota-on-old-devices-but-new-enough-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...droid/platform_system_core/0020-fix-Nubia-6-series-custom-rc-action-prop-validation.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0021-HACK-Ignore-errors-when-setting-fscrypt-directory.-S.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0022-Keep-our-own-version-of-ro.logd.kernel.-We-do-want-l.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/trebledroid/platform_system_core/0023-Keep-capex-when-there-are-vendor-apexes.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0024-When-setting-ro.apex.updatable-actually-set-the-valu.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/trebledroid/platform_system_core/0025-If-AVB-fails-ignore-disable-AVB.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_core/0026-Flattened-apexes-no-longer-exist-we-ll-deal-with-it-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
...roid/platform_system_core/0027-Revert-init-remove-session-keyring-workaround-for-ol.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
From 2166c5b3c22738cec0f838c69229cc7d7c8a3363 Mon Sep 17 00:00:00 2001 | ||
From: Alberto Ponces <ponces26@gmail.com> | ||
Date: Sun, 20 Oct 2024 21:15:08 +0100 | ||
Subject: [PATCH 27/27] Revert "init: remove session keyring workaround for old | ||
kernels" | ||
|
||
This reverts commit 5d7c35ce205f1b4afadd6a1725c0b5e03962a97c. | ||
--- | ||
init/Android.bp | 1 + | ||
init/builtins.cpp | 3 +++ | ||
init/fscrypt_init_extensions.cpp | 16 ++++++++++++++++ | ||
init/fscrypt_init_extensions.h | 1 + | ||
init/fuzzer/Android.bp | 1 + | ||
init/init.cpp | 6 ++++++ | ||
6 files changed, 28 insertions(+) | ||
|
||
diff --git a/init/Android.bp b/init/Android.bp | ||
index 57e5a681a..bad33d94f 100644 | ||
--- a/init/Android.bp | ||
+++ b/init/Android.bp | ||
@@ -191,6 +191,7 @@ libinit_cc_defaults { | ||
"libfs_mgr", | ||
"libgsi", | ||
"libhidl-gen-utils", | ||
+ "libkeyutils", | ||
"liblog", | ||
"liblogwrap", | ||
"liblp", | ||
diff --git a/init/builtins.cpp b/init/builtins.cpp | ||
index 3be6c7cb9..7558f4dff 100644 | ||
--- a/init/builtins.cpp | ||
+++ b/init/builtins.cpp | ||
@@ -596,6 +596,9 @@ static Result<void> queue_fs_event(int code) { | ||
} else if (code == FS_MGR_MNTALL_DEV_FILE_ENCRYPTED || | ||
code == FS_MGR_MNTALL_DEV_IS_METADATA_ENCRYPTED || | ||
code == FS_MGR_MNTALL_DEV_NEEDS_METADATA_ENCRYPTION) { | ||
+ if (!FscryptInstallKeyring()) { | ||
+ return Error() << "FscryptInstallKeyring() failed"; | ||
+ } | ||
SetProperty("ro.crypto.state", "encrypted"); | ||
|
||
// Although encrypted, vold has already set the device up, so we do not need to | ||
diff --git a/init/fscrypt_init_extensions.cpp b/init/fscrypt_init_extensions.cpp | ||
index 6a561e54c..fbd818957 100644 | ||
--- a/init/fscrypt_init_extensions.cpp | ||
+++ b/init/fscrypt_init_extensions.cpp | ||
@@ -34,12 +34,28 @@ | ||
#include <cutils/properties.h> | ||
#include <cutils/sockets.h> | ||
#include <fscrypt/fscrypt.h> | ||
+#include <keyutils.h> | ||
#include <logwrap/logwrap.h> | ||
|
||
#define TAG "fscrypt" | ||
|
||
using namespace android::fscrypt; | ||
|
||
+bool FscryptInstallKeyring() { | ||
+ if (keyctl_search(KEY_SPEC_SESSION_KEYRING, "keyring", "fscrypt", 0) != -1) { | ||
+ LOG(INFO) << "Keyring is already created"; | ||
+ return true; | ||
+ } | ||
+ key_serial_t device_keyring = add_key("keyring", "fscrypt", 0, 0, KEY_SPEC_SESSION_KEYRING); | ||
+ | ||
+ if (device_keyring == -1) { | ||
+ PLOG(ERROR) << "Failed to create keyring"; | ||
+ return false; | ||
+ } | ||
+ LOG(INFO) << "Keyring created with id " << device_keyring << " in process " << getpid(); | ||
+ return true; | ||
+} | ||
+ | ||
// TODO(b/139378601): use a single central implementation of this. | ||
static void delete_dir_contents(const std::string& dir) { | ||
char* const paths[2] = {const_cast<char*>(dir.c_str()), nullptr}; | ||
diff --git a/init/fscrypt_init_extensions.h b/init/fscrypt_init_extensions.h | ||
index 5e0269a3b..d357bb2fd 100644 | ||
--- a/init/fscrypt_init_extensions.h | ||
+++ b/init/fscrypt_init_extensions.h | ||
@@ -25,5 +25,6 @@ enum class FscryptAction { | ||
kDeleteIfNecessary, | ||
}; | ||
|
||
+bool FscryptInstallKeyring(); | ||
bool FscryptSetDirectoryPolicy(const std::string& ref_basename, FscryptAction action, | ||
const std::string& dir); | ||
diff --git a/init/fuzzer/Android.bp b/init/fuzzer/Android.bp | ||
index 5823932d2..65d280335 100644 | ||
--- a/init/fuzzer/Android.bp | ||
+++ b/init/fuzzer/Android.bp | ||
@@ -31,6 +31,7 @@ cc_defaults { | ||
"libbase", | ||
"libfs_mgr", | ||
"libhidl-gen-utils", | ||
+ "libkeyutils", | ||
"liblog", | ||
"libprocessgroup", | ||
"libselinux", | ||
diff --git a/init/init.cpp b/init/init.cpp | ||
index 19e909fcb..aeccd6696 100644 | ||
--- a/init/init.cpp | ||
+++ b/init/init.cpp | ||
@@ -54,6 +54,7 @@ | ||
#include <android-base/thread_annotations.h> | ||
#include <fs_avb/fs_avb.h> | ||
#include <fs_mgr_vendor_overlay.h> | ||
+#include <keyutils.h> | ||
#include <libavb/libavb.h> | ||
#include <libgsi/libgsi.h> | ||
#include <libsnapshot/snapshot.h> | ||
@@ -970,6 +971,11 @@ int SecondStageMain(int argc, char** argv) { | ||
<< " to /proc/1/oom_score_adj: " << result.error(); | ||
} | ||
|
||
+ // Set up a session keyring that all processes will have access to. It | ||
+ // will hold things like FBE encryption keys. No process should override | ||
+ // its session keyring. | ||
+ keyctl_get_keyring_ID(KEY_SPEC_SESSION_KEYRING, 1); | ||
+ | ||
// Indicate that booting is in progress to background fw loaders, etc. | ||
close(open("/dev/.booting", O_WRONLY | O_CREAT | O_CLOEXEC, 0000)); | ||
|
||
-- | ||
2.34.1 | ||
|
2 changes: 1 addition & 1 deletion
2
patches/trebledroid/platform_system_vold/0001-Allow-deletion-of-symlink.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...trebledroid/platform_system_vold/0002-Failing-to-create-facedata-shouldn-t-be-fatal.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
patches/trebledroid/platform_system_vold/0003-Don-t-unmount-rw-system.sh-binds.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/platform_system_vold/0004-Exfat-can-be-mounted-with-exfat-kernel-fs-driver-or-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.