From daa7a3d95d3992597ffc11035782e1a44264ad4a Mon Sep 17 00:00:00 2001 From: Vincent Donnefort Date: Mon, 6 Nov 2023 14:03:24 +0000 Subject: [PATCH] ANDROID: KVM: arm64: mount procfs for pKVM module loading modprobe needs /proc/cmdline to pass module arguments to the module loader. Sadly, so early in the boot, nothing mounts that FS. Bug: 301483379 Change-Id: Iaab3000e3b7f908fc81f7f36adf2f73c7d3129a4 Signed-off-by: Vincent Donnefort --- arch/arm64/kvm/pkvm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/pkvm.c b/arch/arm64/kvm/pkvm.c index 1cff760b8f23..10b899483d43 100644 --- a/arch/arm64/kvm/pkvm.c +++ b/arch/arm64/kvm/pkvm.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -21,6 +22,9 @@ #include #include +#include +#include + #include "hyp_constants.h" DEFINE_STATIC_KEY_FALSE(kvm_protected_mode_initialized); @@ -682,7 +686,11 @@ int __init pkvm_load_early_modules(void) { char *token, *buf = early_pkvm_modules; char *module_path = CONFIG_PKVM_MODULE_PATH; - int err; + int err = init_mount("proc", "/proc", "proc", + MS_SILENT | MS_NOEXEC | MS_NOSUID, NULL); + + if (err) + return err; while (true) { token = strsep(&buf, ",");