From e3cbd650f503ffe059cac271b20e47fd6afebcc1 Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 26 Jun 2023 02:50:12 +0200 Subject: [PATCH] stratovirt: add micro_vm-allow-SYS_clock_gettime.patch --- .../virtualization/stratovirt/default.nix | 1 + .../micro_vm-allow-SYS_clock_gettime.patch | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/applications/virtualization/stratovirt/micro_vm-allow-SYS_clock_gettime.patch diff --git a/pkgs/applications/virtualization/stratovirt/default.nix b/pkgs/applications/virtualization/stratovirt/default.nix index 2c27b2f3cf46..b9fbc191d9c1 100644 --- a/pkgs/applications/virtualization/stratovirt/default.nix +++ b/pkgs/applications/virtualization/stratovirt/default.nix @@ -13,6 +13,7 @@ rustPlatform.buildRustPackage rec { rev = "v${version}"; sha256 = "sha256-K99CmaBrJu30/12FxnsNsDKsTyX4f2uQSO7cwHsPuDw="; }; + patches = [ ./micro_vm-allow-SYS_clock_gettime.patch ]; cargoSha256 = "sha256-SFIOGGRzGkVWHIXkviVWuhDN29pa0uD3GqKh+G421xI="; diff --git a/pkgs/applications/virtualization/stratovirt/micro_vm-allow-SYS_clock_gettime.patch b/pkgs/applications/virtualization/stratovirt/micro_vm-allow-SYS_clock_gettime.patch new file mode 100644 index 000000000000..6aa0da30c44a --- /dev/null +++ b/pkgs/applications/virtualization/stratovirt/micro_vm-allow-SYS_clock_gettime.patch @@ -0,0 +1,25 @@ +From af3001b1b2697ae3165e2fdf47a560fd9ab19a68 Mon Sep 17 00:00:00 2001 +From: Astro +Date: Sun, 18 Jun 2023 23:10:23 +0200 +Subject: [PATCH] micro_vm: allow SYS_clock_gettime + +--- + machine/src/micro_vm/syscall.rs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/machine/src/micro_vm/syscall.rs b/machine/src/micro_vm/syscall.rs +index 89ce5c29..2a6aa0cc 100644 +--- a/machine/src/micro_vm/syscall.rs ++++ b/machine/src/micro_vm/syscall.rs +@@ -128,6 +128,8 @@ pub fn syscall_whitelist() -> Vec { + #[cfg(all(target_env = "gnu", target_arch = "x86_64"))] + BpfRule::new(libc::SYS_readlink), + BpfRule::new(libc::SYS_getrandom), ++ #[cfg(target_env = "gnu")] ++ BpfRule::new(libc::SYS_clock_gettime), + madvise_rule(), + ] + } +-- +2.41.0 +